3 ms·
I've never really understood layer-level grouping. Ideally, the more likely things are going to change together, the closer together you have them. Given that
by sbov 12y ago
I've never really understood layer-level grouping. Ideally, the more likely things are going to change together, the closer together you have them.
Given that, it's less likely that you'll change the code for all your models than change the view+controller+model code for a given feature.
- mrbrowning 12y agoThat's an ideal scenario, though, that implies that all of your view/controller/model through-lines can be isolated vertically from each other. In fact, controllers often coordinate the actions of multiple models to achieve higher-level objectives, and it's at this point that the relatively greater cohesiveness of layers versus features becomes apparent.
- rafekett 12y agoit's useful in practice for denoising file names. unfortunately rails doesn't do this at all, and every controller file is something like `app/controllers/foo_controller.rb`. in Python, if you had a file `app/controllers/foo.py` you'd be able to `from app.controllers import foo`, which is more useful and does an equally good job of declaring the file is a controller without having to write `_controller.rb` every time you do anything with a file.
- juliangregorian 12y agoOr you would just use the class because it's already in the autoload paths. Seeing a lot of opinions from people who don't actually seem to use rails.
- rafekett 12y agoau contraire. I have worked on what I suspect is one of the largest Rails apps out there. autoload has been off for a long time (along with many other "convenient" features) for performance reasons. that's beside the point though, because if you're outside the Rails world you will have to type the whole name of the file if you want to do something with it.