Why I Hate Rails - After six months you’ll be lucky if you have this
kakubei.blogspot.com
kakubei.blogspot.com
Nine months ago, a friend of mine suggested that I consider Rails for a new project I was thinking about. I had never even heard of Rails (remember, this was nine months ago), but I gave it a shot anyway. I started working on my app on Friday night after work, and I followed Michael Hartl's tutorial as a starting point. I had a general idea of the MVC pattern so I was good there, but up until that weekend I'd never written any kind of code other than C#. By Sunday night I had an MVP for my niche ERP that I'd been wanting to build. By the end of that month I'd fleshed it out and sold a license for $$$ to a company in my niche. I've been maintaining it ever since, I've worked as a contractor on Rails projects, and I'm happy.
I'm not special. I'm not some kind of super-programmer. I couldn't even pass college-level calc. I don't want to sound like an ass, killahpriest, but I learned Rails "in a weekend" because I didn't blame my tools for my shortcomings. I didn't just follow instructions; I did my best to understand the steps I was taking. Learning new technologies is like reading books. They all have certain things in common, and if you learn those commonalities, you can pretty much breeze through just about anything. I suppose that's what they try to teach in computer science departments...
Providing a beginner friendly environment and introduction to programming was never one of the motivations behind Rails. If that's a role it can play well then that is all the better. I want tools to exist which help more people learn to program and which give them the satisfaction of being able to build useful applications quickly. However I think it unfair to take a framework which set out to make reasonable decisions about a fairly well defined class of problems in order to make experienced developers more productive in that domain and blame it for being a poor platform to learn programming on.
When is it fair to "hate Rails" and when should we being saying "wow, I guess there is a lot to learn about building software"?
Recently I interested in learning a bit of backend programming. I did start learning Node.js and Rails together.
I hate Rails too. All Rails tutorials and guides are like reader knows everything they know. I feel it was easier before but now there is so much you need to learn to make a real world Rails app. Sure that Twitter clone is easy. But it gets hard when you want to make a bunch of "gems" work together. You need to know a lot of history of Rails in order to get it.
I liked Node.js over Rails not because I know JavaScript better than Ruby, I never had problems writing or reading Ruby code. It's a beautiful language. The reason I love Node is that I know what is going on. There is not much unnecessary magic.
I know it's not fair to compare a "framework" with a "whatever-we-call-node-js". But Node my points are:
- Rails itself is very skinny that can't do much without gems
- By adding multiple gems to make the framework usable you get into truble of making them work together.
So if Rails wants to solve all my problems it should include all functionalities I (usually) want or if it tries to be skinny and light it should be like Node.js
[1] https://www.edx.org/courses/BerkeleyX/CS169.1x/2013_Spring/s...
If Gates, Zuck, and everyone are pushing to have programming in grade schools, I fear more articles that are similar.
We all have our strengths and weaknesses. Some of us can wander into a new language, start making a mess but at the end of the day something works. Others, wander into a language, look around, try and slap something together and then blog about how things don't make sense. Put me in a garage with a disassembled motor? I'll be lost, open a book, but I won't blog about it...
At this point you're probably asking what's the point of this comment? I felt the same about the blog. A waste of time.
I really like Ruby the language. Not so sure about the ecosystem of modules, tools, and frameworks, but maybe that part gets better after you put in a few years.
A lot, if not all of this, just kind of "clicks" if you've already worked with something similar in some shape or form in the past.
Things I'd mark off your list as it isn't Rails specific (You came from PHP, right? None of this should be new if you've built a modern web app):
- HTML
- CSS
- Javascript/JQuery
Things I'd mark off your list as it's Ruby specific (PHP was built for the web, but you can run things in isolation if you want. You want to learn Rails, need to learn Ruby - It's just modular in this setup.):
- Ruby
- ERB Syntax (It's just Ruby inside an HTML file wrapped in <% %>, there's nothing really special here)
- Gem Management (gem install my_gem isn't hard and is second nature for anyone who knows Ruby)
- Bundler (Make a Gemfile, type gem 'my_gem' - Done)
Things that are left:
- Rails Philosophy
- Rails Commands
- ActiveRecord
- Rake (Not Rails specific - Just you there are rails specific tasks)
- Routing
- Deployment
Those 6 (5 if you don't count Rake as it's pretty common in a lot of Ruby projects) can be knocked out in the first few chapters of Agile Web Development with Rails(http://pragprog.com/book/rails4/agile-web-development-with-r...). Some things will take practice before getting used to, but for the most part things should be making sense after playing around with it for a few days.
I think the issue here is you're jumping into RoR without a lot of background knowledge that is there for anyone who has dealt with something similar. You're tackling a lot of different things at once so it's overwhelming. Learn things in steps and you'll be all set, don't bite off more than you can chew. Good luck!
I agree that it is incredibly difficult to get up and running on Rails. Efforts are under way to get one click installs working so that you can get working in no time at all but these all take time and money to develop.
Just because a software engineer completed a college course does not mean they have finished learning, they're just beginning. That's why I love this profession, there is always something else to learn and apply.
Stick at it, you've learned a lot, BUT there's ALWAYS going to be a lot more to learn no matter the domain.
I agree that the whole premise of Gems is frustrating and deploying isn't as straight-forward as FTP'ing a folder of PHP files. This is where services like Heroku come in very handy but then that's another problem: relying on a 3rd party service to simplify deploying a Rails app.
Disclaimer: I'm a PHP developer.
One of the times I was at the Seattle Rails Meetup, 4 of the 8 people there were trying to do this. One of them has been trying to do this for at least 2 years with only puting in a few hours per week. It's been pretty painful to watch.
Disclaimer: not a Rails dev or even a fan, but still the Rails hate is going a little overboard.
Gem management, ActiveRecord, SQL, rake, ERB syntax--these are just some of the ways in which that complexity is manifested in the Rails stack. Any sort of large community-maintained and developed web stack is going to have these same pieces of complexity, possibly in different forms.
The difference is that Rails makes it easy to get started without understanding everything. In my experience over the last 6 months, I was able to make useful stuff before I fully understood everything. I've continued to learn as I needed and it's been fine.
Those gems sound cool by the way - any analogs in PHP?
$ pecl install mongo # MongoDB driver
$ pecl install imagick # ImageMagick wrapper
$ pecl install apc # Bytecode cache
There is also pear which I never use, and Composer, which is similar to Bundler (Composer is better IMO).
If you don't know any of this, you will have a hard time and you will find a large amount of the community unwilling to hold your hand as you struggle to figure out the basics.
Please keep this up at least until I get to the office tomorrow so I can send him the link. :)
* They tell you you don’t have to learn anything else except Rails, that this is one of the greatest advantages it has.
Every single introductory book or blog post to Rails I have read says something like "While knowing Ruby completely isn't a prerequisite to Rails, here's the minimum to get going and you should teach yourself the rest as you go". * Oh, but you do know about MVC right? The whole Model, View Controller philosophy? Right?
Not sure why having a design pattern is such a problem. I'd say it makes things easier after learning it. * Sure, it’s awesome, once you get the hang of how to install and maintain your gems. Is that hard?
If you're diving into rubygems and adding a bunch just to see what happens then you will probably run into trouble. I have followed the Agile Rails and railstutorial.org tutorials and never got into gem trouble there. * Yeah, good luck, first you have to install [rbenv] it with Homebrew
Homebrew is so awesome, especially for beginners. 5 minutes Googling and half an hour should give you enough knowledge to know how to install rbenv (brew install rbenv && brew install ruby-build)I'll skip the rest of the technology rants as it's more of the same.
I might as well get a PHD in aerospace engineering instead of learning all this shit just to create a few web pages.
I dare say that aerospace engineering involves a few more literal moving parts than a Rails application. You can take comfort in the fact that creating a Rails app is nowhere near as bad as deploying one.
This was written on 8th May 2012. The author lists off all of the technologies Rails requires you understand but amongst all of his research had never heard of Heroku?There are a lot of moving parts in Rails because it does a lot of things. The author is right that there is a lot to learn in Rails but it's not clear what he's comparing it against. If he wants to make websites with iWeb and work at that level of complexity then I'm happy for him. However this rant reads more like a 5 year old complaining after he tried to drive a car and hadn't learnt how to ride a bike yet.