Yes, this is a Ruby versus PHP post.
And my conclusion up front: while I don’t hate PHP, I just don’t enjoy
programming with it compared to how much I enjoy programming with Ruby. Given
the choice I would always choose to develop in Ruby over PHP.
However that doesn’t mean I’m a great Ruby programmer. I regularly fail to do
things according to the Ruby Way.
michaeltwofish clearly gets a
lot of satisfaction from suggesting how to improve my code and make it less
But how fair is it to compare the two languages? You could easily class PHP as
a High Level Language and Ruby as a Very High Level Language and say comparison
isn’t fair, it’s comparing “apples with oranges”. Except this isn’t an
intellectual exercise, it’s about selecting a tool to effectively build high
quality software for the web. And from where I’m sitting, it’s Ruby every time
(Rails often too, but not all the time).
I’ve been doing a lot more Ruby and Rails recently because I want to (and I
don’t have an job, so I have plenty of time to do so) and because of an
interview I had a couple of months ago.
The interview was for a Ruby on Rails position. Until recently most of my
experience was with PHP. I’ve built a couple of small things with Sinatra (very
satisfying), and a timetracker in Rails 2.1 or thereabouts some years ago
(which was only recently retired, also satisfying that it worked almost
flawlessy for this long). But since the interview I’ve now built a fully (unit
and acceptance) tested factory production (literally a manufacturing factory)
application in Rails 3.2, and I certainly learnt a lot (in a short space of