5

What are some pros/cons for using camelCase vs hyphens in URLs for a username? As in, what is better (in terms of readability, writability, style, SEO, other):

  1. example.com/justinBieber (a la Instagram, YouTube, Twitter)
  2. example.com/justin-bieber (a la Quora, Wikipedia, LinkedIn)

External references will also be welcome.

5
  • 1
    I've always thought url's are case insensitive (or should be), so camel case isn't really different from just writing everything without hyphens? Commented Jun 15, 2015 at 6:29
  • 1
    Google says: use hyphens. Jakob Nielsen says: don't rely on casing.
    – Uwe Keim
    Commented Jun 15, 2015 at 7:43
  • @locationunknown: The URL path component is case-sensitive (as well as the query and the fragment components).
    – unor
    Commented Jun 15, 2015 at 12:08
  • I prefer hyphens but even if url is something ugly like example.com/54sf4s65f4s5f4/ most of the times people don't care because link use real text, bookmarks use page tite and browser decide to hide url as soon as you scroll.
    – ColdCat
    Commented Jun 15, 2015 at 21:38
  • @ColdCat I think this is a common misconception, it is important to have human readable URLs for various reasons such as being able to quickly identiy where you are on the site and having it look good for times you cant use links and have to use the actual URL (such as sending in emails)
    – tim.baker
    Commented Jun 17, 2015 at 12:14

4 Answers 4

4

URLS in general are case sensitive so you could go and use both. But Users don't tend to write urls capitalized and as far as I've seen most urls use dashes it's also simpler this way to see what words are inside the url.

Also note that your example displays a username, it's better to reflect the actual username and you won't be adding hyphens to a username, in this case either don't capitalize or use it as the user did input the name.

Lots of people here use Experts Exchange as example, which would result in ExpertsExchange, which might read strangely. Yet still it's entirely up to what you are most comfortable width both is allowed.

I've once had a website hosted on IIS not sure if anyone still uses this, but this wasn't case sensitive and you'd be able to write the url like http://myurl.com/expertsexchange. In this case you'd wish you'd use dashes.

Still, entirely opinion based. but I find the hyphens easier to read.

3
  • URLs in general are not case sensitive. Furthermore you are relying on the user to get the case correct - this shouldn't be the case and the UX should be that either way would work
    – tim.baker
    Commented Jun 17, 2015 at 12:15
  • 1
    Technically URL's are case sensitive, depending on your OS. Most websites are run on a Linux env. you can perfectly fine have an index.html and an Index.html or even an InDeX.html. Also allowing both capital case and lowercase is not good for your SEO which is kinda relevant to UX. What you could do, I did not mention because it feels irrelevant is to make sure it always redirects to either situation. Commented Jun 18, 2015 at 6:40
  • And I do care about UX, but I should not go against standards. Here you go URL's should be case sensitive: w3.org/TR/WD-html40-970708/htmlweb.html "URLs in general are case-sensitive (with the exception of machine names). There may be URLs, or parts of URLs, where case doesn't matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive. /u" Commented Jun 18, 2015 at 6:42
1

readability – Visual separation of separate items in the reader’s mental model is a good thing. In Western names, spaces have been used for that traditionally and the best approximation (while %20 is displayed verbatim) is the underscore _ that MediaWiki is using. Hyphens couple two items in a specific order, they are used in given names and in family names but not between both. Initial capitals are the default in proper names, but medial caps have also been used to tie a prefix to a base (McDonald etc.). Keep in mind that lowercase ‘l’ may look like uppercase ‘I’ and there are some other potential lookalikes; it will not always be obvious from the context which one was meant. This alone may be enough to discourage uppercase letters without preceding space or other explicit separator.

writability – Case insensitive roman letters without other characters is probably the easiest for most writers. There will be spaces between logical items, and probably other separators that should not be used to differentiate two user names: my name = myname = my-name = my_name = my%20name = MyName = $MY<NA*ME!

style – Some people like to get creative with choosing and typesetting their name, e.g. upside-down or reverse letters from IPA, Cyrillic butterflies, emoji, letters repeated more than once, digits for letters, cRaZy case mix, markup etc. For the sake of usability you should not let them, but for user experience it may be nice and there can be a canonical user name automatically generated from a display user name.

SEO – For user names? Don’t bother.

2
  • 2
    Why not bother for usernames? Depending on the platform it might totally be relevant. In for example Youtube people will actually search for usernames and sometimes through google. Commented Jun 15, 2015 at 11:06
  • @MathijsSegers Because it will already be covered by optimizing for readability and writability. Any further attempt to optimize for current search engines will degrade R&W, hence human usability.
    – Crissov
    Commented Jun 15, 2015 at 14:40
0

I tend to use hyphens and lower-case letters.

From Google: "Consider using punctuation in your URLs. The URL http://www.example.com/green-dress.html is much more useful to us than http://www.example.com/greendress.html. We recommend that you use hyphens (-) instead of underscores (_) in your URLs."

Google source: https://support.google.com/webmasters/answer/76329?hl=en

My arguments: - Google can read and interpret words separated by a hyphen - the URL remains readable to humans

Sven

0

As far as I think, neither. Let me explain.
If you have one username for all of your accounts (hyphen or not), then use that username.

But this is very unlikely for most people. If you pick a username, most of the time, you have to use that forever (Ex: Google). In addition, to pick the desired username, that username should be available in the first place. If that username is already taken, then you have to select something else.

Furthermore, some websites don't let you pick a username. You have to get what they gave to you. For example, in Quora, the username will be automatically created based on your name and it will be created with a hyphen (Justin-Bieber). So, you don't have a choice there.

Other websites like StackExchange won't give you a username at all. They give you a number (670***). Not to mention, some websites add additional paths such as 'In', 'User", 'Profile", etc to the URL. (Ex: linkedin.com/in/justinbieber/)

No matter how careful you're, you're always not getting the perfect username. Therefore, my recommendation is, if you want a better URL (or a username), buy a domain in your name (or in your brand) and use it to link (redirect) all of your profiles. This way, you have the control of your usernames and URLs. It's good for the writability, style, SEO, etc.

Here is an example...

JustinBieber.com/Instagram - Redirect to https://www.instagram.com/justinbieber JustinBieber.com/Quora - Redirect to https://www.quora.com/profile/Justin-Bieber JustinBieber.com/LinkedIn - Redirect to https://www.linkedin.com/in/justinbieber/

JustinBieber.com/Instagram
JustinBieber.com/YouTube
JustinBieber.com/Twitter
JustinBieber.com/Quora
JustinBieber.com/Wikipedia
JustinBieber.com/LinkedIn
JustinBieber.com/StackExchange

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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