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

I am with you on this. What's magical in Rails? It imports classes for you by name based on their file path, "resources" routes to one of seven methods, templates are expected to be in a directory and named based on controller name and action, it defines methods on models for you based on the column names in the database, it runs files you you put in the initializers directory. All of this stuff is convenient, gets rid of boilerplate, and isn't hard to understand.


I've been a Rails developer for half a decade now, and I wish I had the time to list all the occasions where I've just about thrown my MacBook out of the window trying to do something that Rails wasn't specifically built to do, or been shot in the foot by ActiveRecord trying to be too smart for its own good. Solving autoloading problems is always a favourite too.

I enjoy using Rails, but sometimes it's a pain in the ass, and usually because it tries to be too clever to reduce the amount of boiler platey code you need to write. In terms of code management, I'd much rather have explicit dependencies. Less `belongs_to :thing`, and more `belongs_to :thing, foreign_key: 'thing_id', klass: Thing`. Makes refactoring and code navigation so much easier.

Also, pre-Rails 5, the defaults for DB migrations and relations were trash.


Of course it no longer seems magical when you understand the implementation. The issue is understanding the application without working your way up from the inner bowels of Rails source.

Things auto running and importing themselves seems magical because no other mainstream language does that




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

Search: