When to use the term "url" or "link"?

Asked

Viewed 4,730 times

7

These days I started a "little debate" here in IT on this subject. I realized that several functions, where we returned the image path (to the browser), was named getImageLink.

For example:

public function getImageLink() {

      return $this->base_url . '/imagens/' . $this->id . '.jpg';
}

The return of this would be:

'http://meusite/imagens/1.jpg'

Then I started thinking that maybe "link" referred to a "url" used with the tag <a>. I do not know if my statement is correct, but in the end I decided to change the name of the methods, which have come to be called getImageUrl.

I picked up the custom when listening to people talking "link" and "url" when it comes to the address of a website we typed in the browser’s navigation bar, for example.

Questions

  • From a programming point of view, I should call this "image path" (for the browser), "url" or "link"?

  • What is "link" and what is "url"? What is the difference between one and the other?

  • To be "link", it has to be something clickable?

  • 4

    Specifically about URL: http://answall.com/q/43224/101

1 answer

13


The "path" of an image, or any resource, is always a URL.

The acronym URL means "Uniform Resource Finder" and describes the address naming pattern of anything that can be accessed on a network.

The term "Hyperlink" is derived from the concept of Hypertext and strongly associated with Web.

Because of the ubiquity of the Web, the 2 terms have become almost interchangeable since every link will point to a URL, and almost every URL you access comes from a link. Informally there will be no distinction or problem in using the 2 terms at will.

In the case of a function such as your example, what is being returned is a URL, not a hyperlink. This will be the case for most functions of this type, unless they exist to mount a hyperlink within a hypertext page.

I find it hard that anyone reading your code will get confused if you use getImageLink instead of getImageURL, but the correct in this case would be getImageURL.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.