Lurker News

Comments (438) 69 threads

Show all comments

Showing thread 34 of 69

fiatjaf2 replies#
This should come at no surprise, although I don't see anyone criticizing Rails anywhere.

I've never written a line of Ruby, but trying to read Rails code evokes me all this: it seems like a framework created with the sole purpose of hiding everything possible from the programmer.

gonyea2 replies#
It's not hiding anything, other than the conventions. Django's spammy boilerplate is just default behavior.
kowdermeister4 replies#
Conventions is something I try to avoid at all costs. Conventions are usually things that are hard to find in documentation. Conventions are things that every experienced user says that "oh, this is common knowledge" and conventions are the reason why things seem to work magically.

Obviously if you follow a framework from day 0 you don't even notice it. For newcomers, it's a source of frustration.

nitrogen#
Frameworks should be designed for experts as well as newcomers. I was a Ruby-only developer and, after starting a full time Rails job, picked it up quickly enough.
lobster_johnson10 replies#
That's not really what convention refers to here. Rails' motto "convention over configuration" simply means that boilerplate should be avoided, and that code should use sensible defaults whenever there isn't information.

For example, ActiveRecord class names map to table names through a simple pluralizer (UserProfile -> user_profiles). That's a convention, no configuration needed. Just write a class and off you go. You can override this behaviour, but you can also write huge apps that just follow the convention. Other frameworks would typically make this mapping explicit.
You do need to read the documentation to see what the conventional behaviour is, but it's not very deep knowledge. It's not much worse than other frameworks, where you need to find how things are configured.

Continue this thread — 10 replies

viseztrance1 reply#
On the other hand conventions are great when reading a foreign code base.

Continue this thread — 1 reply

gonyea1 reply#
Your complaint is more about implicit vs. explicit. Implicit behavior is bad when it's surprising. When it's what you would have done anyway, then making it explicit creates an unthinking, tedious ceremony that you repeat daily.

Some of my favorite Rails devs are former Python devs. They appreciate conventions and the freedom they give you.

Continue this thread — 1 reply

collyw#
What do you see as Django's spammy boilerplate?
enraged_camel1 reply#
Rails has plenty of critics. You just aren't looking hard enough.

The most common criticisms are: it's slow and it has too much "magic."
At the end of the day, it comes down to this: every framework has its pros and cons. When you use a framework, you gain certain benefits but sacrifice certain things and have to conform to the framework's opinions. In the case of Rails, the primary benefit is extremely fast prototyping. But that's only possible because the framework hides a lot of complexity from you, which can bite you in the ass if you try to go outside its conventions.