I don't buy into that one either. Where possible I always use relative URL's.
Exactly.
There is also the added argument (quite valid) that absolute URL's require the browsers make an additional DNS lookup for each request, and therefore they are much less efficient to use than the rels. This was more of a concern in days gone by, but I'm one of those that subscribe to the principle that just because CPU power and memory resources are almost limitless these days, it is no excuse for sloppy inefficient programming.
Heck, I still use bit patterns and masking in a lot of my code for variable 'flags' (why use 8 bytes of data for 8 different variables when the same info can by handled in a single byte?). Clearly there is no *compelling* reason to skimp in this manner to save "thismuch" memory, but I do like my code to be as efficient as possible. :-)
I wonder how much memory (and bandwidth) I/we can save (across the entire globe) if no one used absolute URL's except where necessary?
I don't think I'd quite go THAT far either. I can't say I've ever created a site/page and intentionally added the base href (never found the need), but at the same time, if/when I come across it in existing (and fully functional code) I wouldn't just dive in and remove it either.
It *may* have been added by some automated process (WYSIWYG HTML Creation tool) , or someone copying and pasting from elsewhere, where it serves no useful purpose, but it may also have been added with good reason by a developer for a specific use case that I/we are unaware of, and as such the removal may bite in unexpected ways.
At the end of the day, as long as everything works as expected and intended, then by definition, it is the 'right' way. If it doesn't, then it is the wrong way. :-)
Cheers
RodG



Reply With Quote
