Why Ruby?

Last year I decided that to bet on Ruby for my career growth. Many “influencers” consider Ruby to be “dying”, or even, “dead”, so why would I bet on Ruby? Because it feels good to write.

Let’s take a step back. In my previous job, I spent almost 18 years writing Perl almost every day; optimizing, integrating, upgrading, everything. I enjoyed Perl when compared to what I knew before-hand, C++, C, and Visual Basic. With C and C++, I learned I am not computer-science-y enough to manually manage memory. I enjoyed Visual Basic for building form-based desktop apps, as well as mobile apps for the budding Windows CE mobile systems of the early 2000’s, but on the web it didn’t quite fit.

I loved writing Perl for many years (though, several 50% annual raises may have tainted this view-point). However, it was nearly impossible to hire someone to write Perl. I also found very few companies actively looking to hire Perl developers for web work (there were a few sys-admin roles, though). This lead me to explore other languages and their frameworks (I’ve written about Why Rails). This lead me to PHP, C#, Python, JavaScript, Elixir, Go, Ruby, Erlang, and even Smalltalk.

I always came back to Ruby, however. When done right, a program becomes almost a Domain Specific Language (DSL) for your business. Add on top of that frameworks like Rails, Jekyll, Sinatra, and Grape. Now you have an expressive way of mapping your business logic onto the web. It’s beautiful when done right:

get '/joke' do
  User.authorize! env
  name = current_user.name
  security_log action: :joke, for: current_user
  "Why did the chicken cross the road?  To get away from #{name}! 🙃"
rescue AuthenticationError
  "The real joke is expecting this to work without authenticating!"
end