This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: /article/111 vs. /article/my-body-wont-let-me
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
DHH has been talking CRUD recently, and although I like some of the ideas, there is one that I disagree with.
DHH seems to prefer using ids in URLs, and uses the logic that "we learnt our lesson from composite and business keys".
URLs are precious. Ideally they should be carefully planned. As soon as you have a popular web property that is highly trafficed and linked too, you realise this.
"Oh man I wish I could just change X"
Of course, you can change URLs, but you end up with growing code to handle the old styles. For SEO purposes you probably want to make sure you 301 perm redirect to make sure Google and co are up to speed. You don't want any juice to be lost via duplicate content.
I really want readable URLs that have meaning. URLs are the gateway to the content. If your users can guess things based on urls then you have won (or you may have lost if your usability is so bad that the user needs to guess urls ;).
If I have visited 100 articles on a site and I want to remember one of them.
I start to type: http://site.com/article/
and at this point I get a dropdown history. If the dropdown is just lots of /article/XXXXX that will not help me at all.
If the dropdown has /article/title-kinda-thing then it does.
If you go with this scheme then you do need to do the thinking about changing URLs. In this case you may want to NOT let anyone change the slug for the article once they have published it, else you need to redirecting old ones all over again.
In general I do like the exercise of seeing how CRUD like you can make your controllers. It can be really tough to have just a few of those methods :)