Dear Internet: Stop Using Dead URLs As URIs

by Jon Davis 7. February 2008 10:52

Microsoft, this especially goes to you.

It's confusing as heck when protocol-declarative dead URLs are used as URIs. It's bad netiquitte, very rude, please don't do that.

As many people know, a URI is an identifier, whereas a URL is a locator. The former is a unique ID for a resource, the latter tells the world how to access the resource over the Internet. They are often one and the same, but a URI is expected to never change without suggesting the change of the resource itself, whereas a URL can point anywhere at any time.

URLs are, in fact, URIs, although URIs are not necessarily always URLs. The url http://cachefile.net/scripts/jquery/1.2.2/jquery-1.2.2.js is also a URI that identifies the specific location of the given resource.

However, in the view of some people, the URI http://schemas.xmlsoap.org/soap/envelope/ is not a URL. Actually, in this case, it happens to be a URL because if you navigate to that URI it will actually return a schema document. But what would happen if there was no document that was returned from that URL? Would it be valid URI? Sure.

Some people, such as Microsoft, think that because you can have a URI that can look like a URL without being a URL and it can still be a URI, you should. No, Microsoft, and whoever else does this. You shouldn't.

Don't get me wrong, URIs that are not URLs are an acceptable practice in general. My issue is that the scheme of "http" should not be present in the URI if HTTP is not relevant to identifying it. A valid URI that is not a URL would be xmlschema://schemas.microsoft.com/2003/10/Serialization/Arrays, whereas an unacceptable URI that is not a URL would be http://schemas.microsoft.com/2003/10/Serialization/Arrays.

If you're going to put HTTP as the scheme of a URI, put a web site there and make it accessible. I would much prefer that a web site that contains http://schemas.microsoft.com/2003/10/Serialization/Arrays be at the specified location than be presented with the URI of xmlschema://schemas.microsoft.com/2003/10/Serialization/Arrays, but to have the HTTP URI with no web site provisioning what the URI is communicating to the reader is just wrong.

I don't take exception to URIs containing tempuri.org, which is shown with a scheme of "http". That is a stub that Visual Studio / .NET throws in that is the maintainer's responsibility to revise. Same with datacontract.org, which I find showing up in WCF communications. Furthermore, using the TLD of ".org" is unacceptable as it suggests that an organizational entity is behind the URI. A more appropriate TLD is no TLD at all, really. Follow "tempuri" with a single dot ("xmlschema://tempuri./resource"), which globalizes the name.  

kick it on DotNetKicks.com

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Computers and Internet | Software Development | Web Development


 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  August 2020  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

View posts in large calendar

RecentPosts