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

looks interesting. I like the way it promotes good coding practices and your idea of relative routes is cool. Don't know about including routing info in controllers though. I wasn't able to tell what the benefit of doing it this way is over having a routes config file. Seems that the routes would get hard to manage in a large app (even with the route browser tool).

+1 for not having to register to DL



Thanks for the feedback. The belief is that though this practice may feel uncomfortable at first it should make things easier to mange in large applications. The premise is routes don't exist without a controller and method to route to - so why duplicate that information in another place? With routes stored somewhere else if you want to change a method name in a big app (especially one you're not the sole author of) there is an extra step of finding all the places that method name was potentially referenced. Routes in controllers is an attempt at being more DRY than routes.rb and less raw than Django's list of regexps.

For what its worth Rails actually generates code with comments that give examples of routes in its controllers: http://tinyurl.com/5jstgu

Regarding not having to register, here are links directly to the bits: http://news.ycombinator.com/item?id=410119




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

Search: