6 ms·
It drives me nuts that new frameworks announce that they've stuffed all your app's routing into one file like Rails does as if that's a feature. I'm not sure I'
by stormbrew 13y ago
It drives me nuts that new frameworks announce that they've stuffed all your app's routing into one file like Rails does as if that's a feature. I'm not sure I've ever seen a large rails app where the routing doesn't become an absolute rats nest.
- saryant 13y agoThis is one of the things I like about the Play Framework. The routes file can be split up across subprojects. http://www.playframework.com/documentation/2.1.x/SBTSubProjects http://www.playframework.com/documentation/2.1.x/SBTSubProje...
- Jormundir 13y agoI would think you'd get a bigger rat's nest with a distributed router, it just wouldn't be as apparent.
- stormbrew 13y agoIt's certainly possible, but it largely depends on how you do it (separation of concerns and all that). You can have a rats nest of header files in C or C++ as well, but no one suggests the solution to that is to only have one header file.
- tyre 13y agoRails allows you to split them up: MyApp::Application.routes.draw do load 'config/routes/more_routes.rb' end I agree that routes files have a tendency to turn nightmarish (combination of low rate of change once set and you almost never have a reason to read them.) At the same time, if you're routes are getting intimidating it may be time to break out application into separate concerns.
- stormbrew 13y ago> At the same time, if you're routes are getting intimidating it may be time to break out application into separate concerns. I agree. But at the same time, not a lot of frameworks out there really help you make your app more modular. Rails certainly didn't until relatively recently (late rails 2, big improvements in rails 3).
- deleted 13y ago[deleted]