3 ms·
> I dislike rails because there's too much magic This was a common complaint about Rails years ago. What are the "magic" parts in current-day Rails that you di
by andrewem 8y ago
> I dislike rails because there's too much magic
This was a common complaint about Rails years ago. What are the "magic" parts in current-day Rails that you dislike?
(I disliked the dynamic finder methods, e.g. find_by_city_and_state, which you would now do using arguments to where(). I also disliked the default routing which made every public controller action routable, if I remember right. Those are now either deprecated or removed.)
- hardwaresofton 8y agoThese days I don't really work with rails codebases, so I don't have any recent examples in mind to call upon. There's just a bunch of stuff you need to know about how rails works before you can successfully read/understand rails code -- I just remember seeing all this stuff in code and I was just thinking "where the f did this come from", and then realizing that the version of rails we were on had this feature that tied together these two parts with some obscure method. I haven't even looked at Rails 5 or worked in a recent Rails 4 codebase so I'm sure things are much better but the code I remember the feeling of being perplexed so often at how a worked in previously wasn't my own so I can't go back and remember what parts really made me angry.
- ritchiea 8y agoHow is that different from any new codebase you have to look at? If anything Rails reduces the confusion because it has a set of agreed to conventions. I can’t think of any decently complex codebase I’ve ever come across that didn’t have it's own weird abstractions that aren’t immediately clear. Disliking Rails’s built in abstractions seems to come down to only liking abstractions your own devs created which sounds like not invented here syndrome.
- hardwaresofton 8y agoIt's more which tools are used to make abstractions -- I find that rails uses and encourages implicit (auto-created methods, stuff injected into a method's scope) abstraction creation rather than explicit (functions/higher-order functions) abstraction creation.
- ritchiea 8y agoInteresting. I've honestly never heard the complaint about "magic" and abstractions made so concrete. I still believe many of auto-created methods are a good thing and generally done with the thinking that if you do X in 80% of cases the same developer also wants Y. Which makes perfect sense to me but I can also see how that would be surprising and/or annoying.