Falling Back In Love With Ruby ...

Photo by Jason D on Unsplash

Falling Back In Love With Ruby ...

·

2 min read

Ruby was the first language I learned to program properly in.

I read the excellent book, "Learn to Program with Ruby" by Chris Pine (available free online btw ... https://pine.fm/LearnToProgram/) and loved how expressive the language was. Being able to write things like 3.times { print "Ruby" } and [1...10].each{ |n| n*(n+1) } made coding in Ruby easy and fun.

Then I heard about a new framework called Ruby on Rails and wanted to learn more about it. Rails made building full stack web apps ridiculously easy (although I didn't appreciate just how easy at the time since it was my first experience using a full stack framework). After Rails I started playing around with Sinatra and ended up writing my own blog and some articles for Ruby Source (part of SitePoint). I even had a book about Sinatra published by SitePoint.

At some point I moved away from Ruby and got heavily into JavaScript. This took my on a journey of learning React and functional coding, with a detour to learn Haskell. I got much better at coding but always missed some of Ruby's features (even basic things like being able to use the succinct and expressive unless n == 0 instead of the ugly looking if(n !==0) ). But despite missing it, I just didn't ever get round to doing much Ruby coding.

And then last week a job opportunity came up that involves some Rails development and I decided to build an app to get back into it the swing of things with Ruby.

I've really loved it. Rails has come on so much over the years, but also has a familiarity to it. Just being able to write things like array.first instead of array[0] just makes it more enjoyable to code. And the or assignment ||= is really nice to use. And the addition of Turbo makes it easy to code reactive apps without ever leaving ruby.

I'm a better coder than I was when I first learned Ruby and it's made me appreciate it even more. I learnt a lot about JavaScript by doing CodeWars challenges, so I'm doing those in Ruby and am learning more tricks every day. I'll keep trying to improve my Ruby skills and my overall coding ability. Hopefully this time I will continue to code in Ruby and build some great Rails apps!