Of all the graphs in The State of Web Development 2006/2007 report that SitePoint and Ektron published recently, the one that stood out the most to me was the one showing the platform currently being used by developers planning to start using Ruby on Rails:
It wasn’t the fact that the graph shows PHP developers to be likely to start using Rails — this makes sense, as someone is more likely to experiment with another open source platform if they’re already using another open source platform — it was the fact that PHP developers are more than three times as likely to start using Rails, even more so than Java developers!
This surprised me, because it’s the Java developers that the Rails movement is targeting (note: purely my own observation, based on the Rails tagline of being able to write “real-world applications with joy and less code than most frameworks spend doing XML sit-ups”). To a Java programmer, Rails might well look like a much simpler way to achieve the same result. But to a PHP developer who is only used to hacking together small apps?
So here’s the question: do PHP coders know what they’re getting in for? Not to suggest that all PHP developers are burrowing away in an unstructured manner (we all know there are plenty of PHP frameworks these days that provide MVC separation and other similar benefits to Rails), but I wonder how many PHP developers are actually using them. Looking at some of the code out there, my guess is less than half.
Java programmers on the other hand are already more disciplined, if only by the fact that a standard at least exists for structuring Java web apps. So are the PHP developers who are keen to move to Rails the disciplined developers, for whom Rails may be a natural fit? Or are they the hacks, who have yet to embrace any structure in their web apps, but are dazzled by the various beautifully designed Rails apps, and impressed by the charisma of Rails’ leading evangelist?
My guess is that it’s the latter, and my message if you’re eager to jump ship: be prepared to feel disoriented. I’m currently midway through editing SitePoint’s upcoming Ruby on Rails book, and while spending so much time in Ruby-land has definitely been good fun, there’s no question that coding in Ruby requires a completely different mindset. Once you’ve made the shift, things become quite intuitive and almost a pleasure to write. But if your previous experience with object oriented programming is just the square-peg-in-a-round-hole approach that PHP provides, Ruby can be quite a headspin. A good headspin — like the buzz from riding a roller-coaster — but a headspin nonetheless.