1. Jun 6th, 2010

    My development stack

    The best part about working with frameworks and libraries is that you don’t have to reinvent the wheel.  Someone else did the hard work, and there’s usually more hard work than meets the eye.

    The downside is that they’re never perfect. Other people’s code may be less buggy than mine, but I still run into bugs that I need to patch.  Then there are incompatibility issues, behavior changes from one release to another, and features I have to extend to meet my specific needs.

    Some frameworks and libraries are good for that.  Some, whatever you gained from using them is quickly lost when you have to debug their complex code, get surprised by changing behavior, or struggle to extend them. More than once, I wasted more time using a library than it would take to write it myself.

    Over time I settled on a few choice frameworks and libraries where the balance was in favor of saving time and building from other people’s expertise. Those may not be the most popular choices out there in Ruby land, but they proved to have the best return-on-investment for me. Here’s a list of my current development stack.

    Bundler — I work on several projects at once, maintaining a single environment for all of them is impossible. Bundler makes the Gem management pain go away. Switch to a different project, or even branch within that project, run bundle exec bash and you’re done. Also works great when deploying and getting the right environment in production.

    Capistrano — Speaking of deploying, I have some misgivings about Capistrano, but overall it’s great.

    Rake — Great for breaking complex jobs into smaller tasks. It’s easier to develop and test when working one task at a time, it also allows complex jobs to pick up they left off, for example, when you bump into a bug or the unexpected.

    Unicorn — My production Web server of choice. I also use it for development. The fact that you can run two or more processes at once makes it faster than Webrick, and when you’re doing UI work, waiting for Webrick is cycles.

    Resque — If it doesn’t have to be done synchronously, I push it off to a Resque worker.

    Pipemaster — Pre-forking server for commands. Think Unicorn (and much of the same code base) but for requests that don’t come through the Web: cron jobs, command line, inbound emails, etc. I also use it to manage my Resque workers, since it’s able to hot-deploy new code with a kill -USR2.

    Padrino — A Web framework based on Sinatra. If you like fast, simple and less layers of abstraction between you and HTTP, you ought to check it out.

    JSON/JQT — More and more of the UI I’m working on is going down the path of static HTML pages, JSON data and jQuery templates. Static HTML is easy to cache (on server or client), and JSON data means less load and higher latency. It also doubles as an API.

    Vanity – I use it for A/B testing and as a metrics dashboard. Some of the metrics come from Google Analytics, some from database queries, or collected by Vanity. Having them all in one place is the easiest way to stay on top of things.

    MongoMapper — I recently moved away from MySQL to MongoDB. Lots of reasons. MongoMapper is similar in spirit to ActiveRecord, and the API is similar in many ways, but it’s not a drop-in replacement. I’d say it’s re-imagining what an ORM should be for MongoDB. Love it so far.

    SyslogLogger — All the logs from all the processes and up in syslog.

    Shoulda — The best ideas of BDD with the bullet-proof simplicity of asserts. I use it for unit, functional and integration tests (the later in combination with Webrat).

    OAuth/OAuth2 — You already have a Twitter/Facebook/Google account, why not use it to log on?

    jQuery — D’oh.

    1. Jun 7th, 2010

      Francesco Levorato

      What a high and powerful stack! Makes me wish to go back coding in Ruby again (I am stuck in PHP land at the moment!).
      Have fun!

    2. Jun 7th, 2010

      atmos

      Shameless plug for local dev, http://www.atmos.org/cider/

    3. Jun 7th, 2010

      Link dump for June 7th | The Queue Blog

      [...] Labnotes » My development stack – Assaf's current development stack. Never heard of pipemaster… [...]

    4. Jun 8th, 2010

      Kris

      Hi Asaf, have you gotten Vanity to run under Padrino or Sinatra currently?

    5. Jun 8th, 2010

      Assaf

      @atmos plug a way. I heard about Cider but didn’t get chance to try it yet.

      @Kris not yet, not getting as much time to work on it as I’d wish for.

    6. Jun 8th, 2010

      johnny

      Did you get a chance to try Cider?

    7. Jun 13th, 2010

      InVisible Blog » links for 2010-06-13

      [...] 13th, 2010 My development stack list of ruby (and vaguely rails) related development tools (tags: ruby rails tools) IEEE P1363: [...]

    8. Oct 20th, 2010

      Jim Alateras

      Assaf,

      Thanks for sharing. Do you use rspec/cucumber in combination with shoulda?

    9. Oct 21st, 2010

      Assaf

      @Jim,

      I don’t use RSpec. It adds very little beyond Shoulda, it breaks more often, and I find that matchers are more painful to use properly than asserts.

      I don’t use Cucumber either. If I told I write code that uses regexp to parse values, everything is declared in one namespace, and functions interact by changing a shared state, would you hire me?

      I apply the same standards and best practices to tests as I do to the rest of the code base. Cucumber is the VB of our generation.

    Your comment, here ⇓