Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

We are currently deciding on a consistent naming convention across a site with multiple web applications. Historically, I've been an advocate of the 'lowercase all the letters!' when creating URLs:

http://example.com/mysystem/account/view/1551

However, within the last year or two, specifically since I began using ASP.NET MVC & had more dealings with REST based URLs, I've become a fan of capitalizing the first letter of each section/word within the URL as it makes it easier to read (imho).

http://example.com/MySystem/Account/View/1551

We're not in a situation where people need to read or be able to understand the URLs, so that's not a driver per se. The main thing we are after is a consistent approach that is rational and makes sense.

Are there any standards that declare it good to do one way or another, or issues that we may run into on (at least realistically modern) setups that would choose a preference over another? What is the general consensus for this debate currently?

share|improve this question
add comment

5 Answers

up vote 10 down vote accepted

As the choice is purely cosmetic (ie, the system doesn't differentiate between upper and lower case), then I'd suggest just going with whichever makes you happy. Consistency within the application is the key, not the manner you choose.

As you're using ASP.Net, I'd recommend going with the PascalCase approach - as that is what tends to exist within the Microsoft framework (system libraries, etc.) But there are no "best practices" other than being consistent.

Most browsers do a fairly good job of hiding the URL from the user, to such an extent that a great many people who have google as their home page, will then search for facebook and click on it - rather than entering the facebook url in their browser.

share|improve this answer
1  
+1 for "Consistency within the application is the key" –  PhillC Feb 28 '12 at 12:05
4  
But the system does differentiate –  ghoppe Feb 28 '12 at 21:10
add comment

For internal websites, it doesn't matter so much as long as you're consistent with it.

For external, public facing, sites, you probably want to stick with lower case which is more or less the standard in Linux/Apache web hosting. As I recall, some versions of Firefox also seem to handle URL casing differently than IE. This might also apply to Chrome as well.

Having consistent casing also matters for search engine optimization. You don't want Google to see lower-case.aspx and Lower-Case.aspx as different pages with duplicate content. While their algorithms try to prevent this mistaken identity, it does happen from time to time and can cause a page to be penalized.

share|improve this answer
add comment

While TLDs are not case-sensitive and Windows paths use a combination of capital and Pascal case, our applications are sensitive to the incoming request paths, where paths, or components therein, are usually normalized to a standard case, since /format/JSON/ and /format/json/ are requests for two different formats and reference two distinct resources.

Whenever I've seen http://www.somewebsite.com/Having/URLs/That-Look-Something-Like-This/, I felt like the developer's intent was mainly to appear a bit different from the rest, but it's nothing innovating and neither does it help improve readability, especially now that you have I and l, O and 0, other letters contending for your analysis.

I'm not aware of any consensus, neither do I believe that there should be one, because something as simple as capitalizing only certain parts of a URL could have a positive impact on readability and I'm sure someone, somewhere is already coming up with interesting ideas when it comes to applying letter cases to URLs.

But, judging by the fact that most Web servers are running on Linux and that we developers always end up standardizing incoming text data because the input is case-sensitive, I'm sticking to how it's been done all along.

share|improve this answer
add comment

As long as users can type it however they want, it really does not matter. Personally, I prefer TitleCase, but there are many who disagree. If you are consistent, no one will mind.

If your web server cannot, for some reason, show me http://foo.com/HelloWorld when I try to go to http://foo.com/helloworld, you should opt for all-lowercase. While people rarely type full URLs these days, front-facing addresses should be accessible without having to fiddle around with capitalization.

share|improve this answer
add comment

NEVER use title case for usability reason! Imagine how many time you should spend and clicks to perform for different case URL in your MOBILE phone!

share|improve this answer
    
Although on my iPhone, title case requires fewer extra keystrokes than '-' or '_'. –  BradS Apr 5 '13 at 12:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.