relative absolute paths



  • I don't like bad surprises so I like to fully qualify classes and paths. But I realized that sometimes websites legitimately move. So, long ago, I started using relative absolute paths:

    <img src="<%=Zenith.GetRootDirectory()%>Graphics/icon.png">
    

    Now I'm reading a dumb "standards" document and among the dumb "standards" is barking about every path having to be relative so links don't break even though it does nothing to stop links from breaking when some mook decides to rearrange the website just because.

    Anyway...I'll be barked at and forced to change, won't I?

    The rest of the documents (yes, documents) are 10 pounds of fluff. There are literally 10 pages of how to color/style the company logo. Don't we just have a logo ready to use that I can plug in? And nothing about accessibility in the accessibility policy. Also, don't people understand that brevity is key? The Indians don't read this or follow any of these rules so why should I? It's not even clear which apply to internal or external sites even though it repeatedly makes the distinction between them.

    To think this whole "you need to talk to Art Nazi" started because I copied the Outlook Dark Theme instead of the Outlook Light Theme...


  • Considered Harmful

    Do you suppose you could use the base tag to specify the absolute path and then have all other links conform?



  • @Applied-Mediocrity I do use the <base> tag as well but I think with this sounding like it was written by people that can't spell HTML it too would fall victim to the relative path language. This is an internal application so I don't know why there's any fuss over it.



  • @Zenith said in relative absolute paths:

    @Applied-Mediocrity I do use the <base> tag as well but I think with this sounding like it was written by people that can't spell HTML it too would fall victim to the relative path language. This is an internal application so I don't know why there's any fuss over it.

    Because you have the misfortune to work with… some very interestingly opinionated individuals. Who are wrong.


  • Java Dev

    One reason to not use fully absolute paths is when a site may be accessible at multiple locations at the same time (EG it's behind a load balancer) and you want browser access to work on all of them for debug reasons. I'd expect that to mostly be the hostname component though, not the path component.

    Dev/test envs might be hosted on a path prefix; you don't want more changes than needed between those. That wouldn't be a problem behind a variable, but that requires everyone always using the variable when writing code.


Log in to reply