I actually tried learning Rails

A few months back I wanted to prototype some ideas that my wife and I have been tossing around for web sites that’d be fun to build up in our so-called spare time. I thought it would be smart to use that as an opportunity to learn Ruby and Rails.

Well, I was half right. Ruby is a very cool language and Perl’s influence on it is clear. (I’m and old Perl guy.) However, Rails has grown since I last looked at it. In fact, it’s grown a lot and that means a lot of complexity and more to learn. I felt a bit uneasy about it. The whole thing made me feel a bit inadequate, to be honest.

Today I came across What the hell is happening to Rails? and this struck a chord with me:

But it just feels like we’re making this herculean effort to write elegant code and disappearing off on our own cloud of perfection, leaving behind anyone who wants to learn rails. We’re making it perfect and keeping up the number of new things to learn per month for people writing rails for the last few years. But we’re making it harder and harder for anyone to join the club from scratch.

And as soon as I read that I realized that it wasn’t “just me” but that Rails has, in fact, become a big framework with a lot of culture (some of it rather odd feeling to me) and a lot of change still ahead of it. It was a relief.

In other words, it was exactly what I did NOT want for some prototyping.

Since then I’ve discovered mojolicious and have been tinkering quite happily. Granted, it doesn’t include everything under the sun (an ORM, for example) but I definitely feel like I can start small and build my way up.

I still think Ruby is a cool language and I’d like to tinker with it more. But Rails is not the best way to learn Ruby.

About Jeremy Zawodny

I'm a software engineer and pilot. I work at craigslist by day, hacking on various bits of back-end software and data systems. As a pilot, I fly Glastar N97BM, Just AirCraft SuperSTOL N119AM, Bonanza N200TE, and high performance gliders in the northern California and Nevada area. I'm also the original author of "High Performance MySQL" published by O'Reilly Media. I still speak at conferences and user groups on occasion.
This entry was posted in perl, programming. Bookmark the permalink.

29 Responses to I actually tried learning Rails

  1. Boris Mann says:

    You might want to give Sinatra a try http://www.sinatrarb.com/ – a slimmed down, API-optimized framework for Ruby.

  2. Take a look at sinatra, or padrino (built on top of sinatra) if you are still interested in tinkering around with ruby and web frameworks.

  3. Pingback: Today’s Shared Links for June 13, 2011 – Chuqui 3.0

  4. Sinatra would be a perfect fit for your needs.

  5. damsieboy says:

    You could also consider the Perl Dancer framework http://perldancer.org/ . It started as a port of Sinatra to Perl, and now has its own friendly spirit and community

  6. Dave S says:

    Agreed, Rails is an unremarkable framework with a remarkably horrid community. The smugness that drips through the comments on that post is tangible, and the pathological conviction that PHP is a toy is just lame. PHP developers grokked MVC long before Rails even existed.

    But I digress. It sounds like you won’t be short of suggestions to “try framework z/y/z” today, but for me, for web projects, it simply has to be Django and Python these days.

    • The MVC pattern has been around for… oh, since 1979? 😉
      The implementation provided by Rails just proved to be extremely popular for web applications.

      You’re right about some Rails developers, they’re snobby and assume everyone else is doing it wrong and they’re doing it right – I’d guess many of them have moved onto Node.js now, because that’s the new buzzword.

    • John says:

      Rails is actually a very pleasant framework, though unfortunately I have to agree with Jeremy that it’s grown too complicated for someone trying it for the first time, and with you that there are some obnoxious voices in the community.

      Django and Python are fine tools too, but your statement that it “just has to be” anything smacks of the same obnoxious attitude you’re accusing the Rails crowd of.

    • John says:

      PHP has yet to grok security.

  7. …or if you’re at all interested in JavaScript on the server, Node is very interesting – http://node-js.org

  8. That’s what happened to Zope3.

  9. jrimmer says:

    Rails is in a great place to create large applications though in doing so it’s left the realm of a place to try quick ideas, presuming you’re not a Rails-expert. I’ve found Padrino http://www.padrinorb.com/, a Ruby framework based on Sinatra http://www.sinatrarb.com/, fits that bill perfectly and in a way that doesn’t preclude a future Rails migration.

  10. Instability says:

    Jeremy, you mention Rails has become “a big framework.” Yes it has, and in my view it’s a lumbering lineman now, rather than an agile athlete as it was early on. The number of dependencies required to just load up an empty Rails 3.x app is staggering. I get more interested in alternatives to Rails every week, whether Sinatra (without ActiveRecord, and it’s bloated dependencies – use Sequel [https://github.com/jeremyevans/sequel] instead), Django, something. Rails is seriously adrift in my opinion.

    • Nick Ragaz says:

      I don’t want to start anything here. But I’d like to point out that the reason for the dependencies is that (a) Bundler makes it easy to manage them; and (b) they reflect Rails 3’s modularity, which allows the use of optional dependencies to add functionality. Most of them are optional and can be removed if you don’t want their magic. But they actually make for a leaner not a more heavyweight framework.

      • Instability says:

        Perhaps “leaner” in the sense that Rails’ own codebase is smaller, but the stack that is loaded is anything but “lean!” Give me less magic, and let me add dependencies for the things I want. Or, as others have said in related threads, turn off those dependencies by default. Trying to remove dependencies and then troubleshoot the mess that results is not my idea of a productive afternoon. There are many dependencies in the default generated rails app, and that means, a.) you have lots of other pieces to learn to be productive, and b.) you’re now subject to the whims of those who are managing the components on which you are dependent when they make their own “coffeescript calls.” I’m by no means demanding that Rails change. Do what you want, but I’m not interested in building my business on it anymore.

  11. Jason Dixon says:

    Yours sounds very much like my story. I think my aversion to Rails is more philosophical than technological (e.g. the Rails community’s lack of understanding for solid engineering principles) but the end result is the same. I’ve been very happy with both Mojolicious (Perl) and Padrino (Ruby). Often I find myself choosing one over the other based on the underlying model. If I want tighter control over my data I lean towards Mojo and DBI; looser constraints and I’ll often use Padrino with ActiveRecord.

  12. Patrick May says:

    Rails was a broken project from the start. Ruby was an amazing language with insufficient support for web development. Rails provided that support but never had the patience to fix the language. Rails was built around ruby’s weakness, and now both are stuck with each other.

    • Alexander says:

      It’s weird — ironic, even — that you claim Ruby has “insufficient support for web development” when Ruby’s popularity has exploded precisely because it’s such a good fit. It’s dynamic, it’s terse, it’s modular, it has an incredibly fast code-to-execution cycle.

      And how can a language have insufficient support for a high-level concept such as development? I grant you that a statically typed, compiled language such as C or Java has bigger hurdles to face in supporting web applications, but even a language like C can, with the right tools, support the same kind of development process. Featurewise, Ruby as a language is analogous to Python, which is also a popular language for web development. So what is this “insufficient support”?

      • Patrick May says:

        Ruby is first Unix scripting languages, and second a web development languages. As a result the interpreter isn’t really designed to provide a consistent web development environment. Depending on whether you use mod_*, cgi, fastcgi, etc a “global” variable is available across requests totally different ways. While many of the great things about the language encourage you to modify “global” variables (aka system classes, etc).

        These issues are significant. With mod_ruby you couldn’t have more than one Rails app per apache server. As a result, the Ruby community has put lots of work into various alternate web servers like Mongrel, Passenger, etc. While deployment of the #1 framework (Rails) for the #1 development market (Web Development) is a priority for ruby platform developers, it’s just not easy to change the interpreter once all the dependencies kick in.

        So yeah. The language and interpreter do not properly support web development. Python doesn’t either really, but it has a stronger culture of encapsulation that protects python developers from these issues. But they still exist. And the open ended nature of Ruby is what is so great about it in the first place… having to lock things down and be extra careful about deployment goes away from everything that made Ruby great in the first place.

  13. Mojolicious looks like Sinatra for Perl, so you might want to check out http://www.sinatrarb.com if you’d like to jump into Ruby again 🙂

  14. Not sure why I’m bothering chiming in, but yes, Sinatra is really where ruby web beginners should start, just look at the home page. For anyone coming from PHP, Sinatra is easier to grok, too.

  15. Will says:

    I’ve got a lot of experience with Ruby, Rails, and Sinatra. Like so many other Ruby developers, I learned Ruby first alongside Rails, and I really wish I hadn’t. Even way back when Rails was in version 1, it wasn’t a good platform for learning the underlying language — too much magic, not enough explanation.

    If I had to do it all over again, I’d learn Ruby from scratch without any framework. Once I had the basics of Ruby down, I’d pick up Sinatra for actually developing apps.

    I may or may not have eventually tried Rails, but it certainly isn’t as well suited for many applications as Sinatra is. Even now, with a very solid handle on both frameworks, I use Sinatra for almost everything.

  16. Pingback: Problem with Frameworks « TechLedger

  17. Pingback: Rails 3 in Action | Programmer Solution

Leave a comment