3 ms·
I like StackOverflow URLs; f.e.: /questions/22881084/couldnt-find-bar-with-id-472021-polymorphic-associations And every URL that matches /questions/22881084
by izietto 13y ago
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
- 3rd3 13y agoI 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
- izietto 13y agoIf 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
- gambler 13y agoI 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.
- MarketerLOL 13y agoyou hate them. the rest of the internet loves them. you are wrong and everyone else is more right than you
- izietto 13y agoReadable 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.
- mherkender 13y agoExpecting 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.
- gambler 13y agoWhen 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-helpful-is-it 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".