Why Ruby? (And why not EventMachine?)

My company uses EventMachine-based servers a lot. This, I think, is a huge mistake.

The advantages of Ruby (as distinct from Rails) are basically threefold:

  1. It’s a very humane language to program in, allowing programmers to produce large amounts of high-quality, tested code quickly.
  2. It has a great community around it that produces lots of high-quality open-source gems for lots of the tasks you might need done.
  3. It’s currently enough of a hot language that you can get a bunch of talented developers who are interested in doing Ruby programming and are facile with the language.

And EventMachine compromises all of those things.

  1. EventMachine is callback-based.  That immediately makes the code tougher to write, understand, and maintain.  And developers just don’t like callbacks.
  2. EventMachine is incompatible with damn near every gem I’ve ever wanted to use.  Anything that involves an external service is going to, by default, be incompatible with EventMachine.
  3. The vast majority of all developers out there who have Ruby experience and facility are used to dealing with Rails: they find EventMachine a stumbling block, and to remove some of the things they enjoy about Ruby development.

In exchange for all of this, you get better performance.

Well, you know what else is kind of a pain in the ass to work with compared to Ruby, but far better performance and natively asynchronous?  Node.js.  Or Erlang, or Go, or a million other languages.  If you’re going to have to deal with EventMachine, you might as well use a truly performant language, and one in which the entire community is based around dealing with the unique challenges of asynchronous code.

EventMachine is the worst of all worlds.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s