Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like StackOverflow URLs; f.e.:

  /questions/22881084/couldnt-find-bar-with-id-472021-polymorphic-associations
And every URL that matches /questions/22881084 redirects to the main URL.

The URL of this news would become:

  /items/7536719/ask-hn-mods-can-you-make-submission-urls-human-readable


I hate those. They contain duplicate information, mostly for the sake of Google rather than users. The fact that /questions/22881084 still works is a nice touch, though. Guess why it's there? People sometimes still type URLs by hand. In that case numerics are actually much nicer than a long-winded textual URL. (An interesting approach would be to use alpha encoding, like ba, bc, bc, etc for the index. More information, easier to type on mobile devices.)

The only case when I like title-based URLs is when they're hand-crafted, memorable and short. Something like example.com/movies/terminator2. Even then you run into problems, because it could be terminator_2 or Terminator_II, or whatever. The moment that URL turns into Terminator_2_Judgment_Day I begin to question its usefulness.

What's wrong with synthetic IDs, anyway? People go on and on about "readability" of URLs, but you have to evaluate it in the proper context. Where are they more readable? If I'm in the browser, I already have the title at three places on my screen (tab, window title, page itself). Sequential numeric ID gives me additional information about order of the articles and sometimes even allows for neat tricks, like skipping to the next article by incrementing the number.


Readable URLs are for whenever you write the link somewhere: I hate when I have to click to bit.ly/4/srkue4oiu, or youtube.com/watch?v=e498hRSUvf, and I have no clues about its contents.

And I read much more the URL than the page title; I totally disagree with the approach "They are URLs, they are for browsers, I don't read them". I read them all the time.


Expecting users (or even yourself) to manually enter URLs like "/movies/terminator2" is just not going to work long-term if you can generate the URL based on the title of the page.

It's also not necessarily duplicate information (more like extraneous information), nor is it a disadvantage to have readable URLs. I'm going to explain why by weighing the pros and cons of the main options as I see them.

/questions/how-do-i-foo-bar

Doesn't allow renaming, can't have duplicates with similar titles. Since the lookup key is "how-do-i-foo-bar" it's a variable width string, which is less ideal than a fixed width number/string.

/questions/342993123

Doesn't have the problems above, but now it's not readable. Users can see these URLs in search engines and perhaps more significantly, when hovering over links to see where they go. Google's own SEO guide recommends readable URLs.

/questions/342993123/how-do-i-foo-bar

Best of both worlds. If you redirect "/questions/342993123/*" to "/questions/342993123/how-do-i-foo-bar", you can even allow users to rename titles without having to store the old URL, all while having one canonical version of each "question".

One last thing, those IDs aren't sequential, they're just unique. If you increment a HN news article URL you'll probably end up in a comment (because articles are just root comments), or on other sites, a deleted/spam submission. Sequential only works for content that doesn't change, and most content changes.


"One last thing, those IDs aren't sequential, they're just unique. If you increment a HN news article URL you'll probably end up in a comment (because articles are just root comments), or on other sites, a deleted/spam submission. Sequential only works for content that doesn't change, and most content changes."

Same kinda thing in StackOverflow, everything is a "post", regardless of whether it's a question or answer, for example:

Consider this answer:

http://stackoverflow.com/a/22884084

If I change the url to replace "a" with "q":

http://stackoverflow.com/q/22884084 or do http://stackoverflow.com/questions/22884084

...it takes you to that "post" which happens to be an answer.

With regards to the parent question, I wouldn't object to seeing human readable slugs. I have a stash of HN article links hived away in OneNote, you be handy not to have to manually type in a description of what the article was about.


When I said "duplicate", I meant that both the number and the title are in themselves sufficient to locate the article.

I get the renaming scenario, but I think it is an edge case.

Most duplication can be avoided by appending date or user name to the title if there is already a similar title in the database.

/questions/foo_bar-by_mherkender /questions/foo_bar-2001-01-01

At least this way unique URLs will be short(er) and more memorable.

Overall, though, I think you overestimate the usefulness of named URLs, because you concentrate on specific cases like people linking to something bad on YouTube (that still has an appropriate title) without giving coherent description. There are other cases too. A lot of them. They just aren't as annoying/memorable.

http://stackoverflow.com/questions/22883751/this-is-not-so-h...?

I read a small magazine about PC games, and I recall using ID jumping for navigation a lot. When the numbers are below 1000, it is easier to remember and type "article=234" than "/article/Does+Assassin's+creed+break+new+ground?".

Also, I sincerely think that the trend for named URLs has more to do with Google that what users want or like. If Google liked super-long URLs with lots of punctuation, most websites would do just that and people would find ways to rationalize the trend. This doesn't automaticall mean title URLs are wrong, but it's somewhat different from "everyone like them".


Using dates is a good alternative, but they're not a universal solution. If Microsoft open-sources Windows XP you can be sure that dozens of articles titled "Windows XP open-sourced!" will end up on HN that day, and a site that rejects articles because they have the same title as another has a bad user interface. That said, if there's a small enough amount of content, it might be good enough.

I'm not saying sequential ID URLs are bad, they're still possible in my suggestion, I was just explaining how navigating by incrementing a number isn't plausible for sites with large amounts of user-generated content. It usually doesn't scale.

Anyway, I'm not overestimating the advantage of readable URLs. You haven't given any reason why readability isn't an advantage in URLs, and I've given several explicit reasons why they are (SEO, hovering over links, etc).


I find these links aesthetically appealing too, however, it seems strange that the title is a sub-path of the item ID. I think something like this would make more sense:

      /items/7536719-ask_hn_mods_can_you_make_submission_urls_human_readable


If you don't need to pedantically follow RESTful approach, that is if you are not developing Web APIs, I believe user experience should be preferred




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: