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.
Link dump for June 7th | The Queue Blog
InVisible Blog » links for 2010-06-13