I know I don’t post too much to this blog, but you might start noticing that I have stopped posting PHP and I started to post about Ruby and Rails. Why’s that? Well, it’s because my company has switched over to being a RoR shop. Here’s my short opinion on it…
Ruby and the rails community seem much more mature and bleeding edge. How can I put those 2 together? Well, all the stuff I was working on PHP has been stuff that has strongly been influenced or straight out copied from Rails. I think Rails was one of the most popular MVCs that inspired all of the other ones (and yes, I know there were MVCs before Rails). You see, symfony draws its design off rails.
app/console -> rails/rake
doctrine -> activerecord
As rails has been doing it for much longer (rails is on version 4), it has a much more developed community. I find myself finding more gems and having to write less of my own stuff compared to php. Granted, I still make PRs to the ruby/rails community now.
I’m still getting my head around Ruby as a language, but it does have a much more concise way to write than PHP. Blocks are something that definitely has an advantage over other languages. Yes, you can implement something similar in PHP or other languages with anonymous functions or callbacks, but ruby makes it very natural and intuitive. Overall, after getting over the initial hump of learning a new language, I like it.
One thing that has helped me transition easier is having Jetbrains IDE. I moved straight from PHPStorm to Rubymine and I was very happy that almost 100% of the keybindings that I was used to using in PHP moved right over to Rubymine. The ruby debugger seems actually more flexible than the php debugger as I can actually execute arbitrary code within a breakpoint. This is great for inspecting objects and variables. You could probably do this with PHP, but it just wasn’t as simple.
I look forward to the next languages I’d be learning. So far, going from PHP -> Java -> PHP -> Ruby hasn’t been a bad experience for me. Each time, I learned something new and was able to apply principles from one language in another. I think learning about different languages helps broaden your perspective on design patterns as each language lends themselves to writing code in a certain manner.