1425999330 people cc

How I went from PHP to Rails

Photo by Waag Society

I’ve used Rails now for about three and a half years, two of which have been as a developer at Netguru. But before Netguru, I was a PHP developer for 5 years in various companies. I had been trying my strength in C, C++, Java, and other languages, but I couldn’t find one that fit me. It was a hard decision to switch to a different language and start all over again from scratch, but looking back on it now, I can say it was worth it.

I’d like to share with you “the switch” I made from PHP to Rails, summarized in 5 points:

  1. The main reason that lead me to this decision is that I hated PHP (although this is not about PHP hate :-)). I was kind of forced to use PHP at my first company, but I love being a programmer, so I gave it an effort and many tries to like it. But as time went on, there was more frustration than love. Each company or project that uses PHP usually works under a different framework, so moving to another company or project means either to learn a completely new PHP framework and its additional libraries (all which are almost always not open source code that has never seen any other computer except by the developer and server).

  2. If you want to make a switch, you need to choose the proper language / framework you want to learn. I heard about Ruby / RoR in 2007, and there was this one developer in our company that tried to implement it in one of the projects, but the rest of PHP programmers didn’t let him finish. On my own, I bumped into Rails in 2008, when I switched companies and we wanted to setup a project-management tool, where I discovered Redmine . Setting everything up turned out to be easy, even though I hadn’t worked with Ruby or Rails at that time. At that point, I was familiar with Rails, but had still never tried to write anything by myself.

  3. Making first steps were quite hard for me. At first, I didn’t know how to even make a simple hello world, not to mention database integration. There was no Ruby version manager, and I didn’t know what Ruby version I should have used to set up Rails. There was no bundler and managing gems was not intuitive. And on top of this, none of my friends were using Rails, so I wasn’t able to ask around. My only resource was Google for solutions, which was limited at best.
    When I was finally able to start up a server, I received random errors, didn’t know what they meant and where to start looking to fix them. I’m not a very patient creature, so I was getting even more frustrated than writing in PHP at this point. So, I had about 3 or 4 separate approaches to Rails, each one introduced different set of issues. I didn’t spent much time on it, 2-3 hours max on each attempt, then I was just leaving the unstarted work as it was.

  4. After several unsuccessful attempts to Rails, my first few controllers and models that I wrote was with Rails 3.0, which came out in 2010. From that point, it was nothing but a pleasure to write new stuff in Rails and see it working. Being used not to use any external libraries as a PHP developer, I also didn’t use any gems at the beginning, so I was writing common solutions (like authentication, pagination) all by myself, because that was the perfect way to learn Ruby and Rails for me. Rails is clean, fun, easy to write in, Ruby syntax is extremely nice, both for people that likes methods that have OVER 9000 lines, and for the one-liner lovers as well. I won’t be going into detail about the differences between PHP and Ruby, but to me, Ruby is just way better organized. The ‘Everything is an Object’ idea makes it great. Not to mention that Ruby has a huge community and every upgrade makes Ruby faster and faster.

I’ve been working as a rails developer for over 2 years and I am learning new stuff every day. I now also use Rails for my own personal projects, and often try new ideas, approaches, and gems, to see how they work and how I can use them in the Netguru’s projects.

That’s my personal story about becoming a Rails developer from PHP. Let me know in the comments if you have a similar story you’d like to share.

If you're looking for Ruby learning resources, start with Top Free Online Ruby Tutorials.

On 29.10.2013 in dev, recruitment, and Ruby/Rails

Great news! We have 10 open positions waiting for you! Come and work with us!