4 ms·
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 evoke
by fiatjaf 10y ago
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.
- gonyea 10y agoIt's not hiding anything, other than the conventions. Django's spammy boilerplate is just default behavior.
- kowdermeister 10y agoConventions 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 10y agoFrameworks 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_johnson 10y agoThat'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.
- majewsky 10y agoMy experience is that programmers migrating to Rails are thoroughly confused by these conventions like "UserProfile -> user_profiles". Although it's only the second-biggest source of confusion after ActiveSupport, e.g. "10.hours.ago" even though the integer class does not have an hours method according to the Ruby documentation.
- kowdermeister 10y agoIntegers have methods? ಠ_ಠ
- lobster_johnson 10y agoYes, why not? 42.times { puts "foo" } 1.upto(9) { |n| puts n } puts 1.year + 7.months - 1.day
- dedsm 10y agoone of the issues I see with rails precisely is that most people won't ever know that 1.year is not a plain ruby method
- lobster_johnson 10y agoIs there a problem? If they don't know, there's not much harm. But surely this is part of the learning process. Understanding leads to enlightenment. There's certainly evidence that tons of developers using JavaScript don't know how classes work.
- bdcravens 10y agoI can call methods on objects in most frameworks/libraries. The fact that I don't know if .trim() is a core Javascript function or part of jQuery isn't a weakness of jQuery. If a "developer" can't be bothered to consult documentation when they work on a slightly different project than they're used to, then they're in the wrong industry.
- viseztrance 10y agoOn the other hand conventions are great when reading a foreign code base.
- kowdermeister 10y agoAnd if conventions don't change :) If a team can follow conventions it's a good thing, but I personally favor explicit code that does nor les nor more than it says. I do use frameworks, but I always pick the minimalist ones where I can see the chance understanding what goes on under the hood.
- gonyea 10y agoYour 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.
- kowdermeister 10y agoCorrect. I never tried Rails, I just know that conventions were always a major pain point for me. Most of the time it hurt me more than it aided me.
- collyw 10y agoWhat do you see as Django's spammy boilerplate?
- enraged_camel 10y agoRails 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.
- mh-cx 10y agoThis. One fine example is Gitlab: It's full of features and does many nifty things. But it's painfully slow and the developers now have a hard time trying to fix this. [1] https://gitlab.com/gitlab-org/gitlab-ce/issues?scope=all&sort=id_desc&state=opened&utf8=%E2%9C%93&label_name%5B%5D=performance https://gitlab.com/gitlab-org/gitlab-ce/issues?scope=all&sor...
- sytse 10y agoThe slowness is not due to Rails. It is mainly due to us not scaling up the infrastructure team fast enough and now having problems with the file serving backend. We're working on it in https://gitlab.com/gitlab-com/operations/issues/42 https://gitlab.com/gitlab-com/operations/issues/42