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

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).




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

Search: