How I switched from PHP to Ruby on Rails (And why)

First of all, I'm going to assume you understand about web development for this article(you know, taking into account that you are in techmafia and in the Web Development clan at the same time..).

Now, a little disclaimer here, You probably know a lot more than what I'm going to write about here. This is my personal experience which I want to share with you.

So, I've been coding, and designing, and developing and blah blah blah since I was a kid. I learned on my own no help whatsoever (not much even now that I'm in college). So I began with Python, then learned Visual Basic, C/C++, later came HTML, CSS, Javascript and finally PHP.

Since then I've been working with PHP for a while, did lots of freelance, got some of my works hacked and learned alot, but it wasn't until recently that I knew how inefficient was my working process (and don't get me wrong I work hard and all day and love it).
It first started with a talk to which I went a couple of years ago. It was about code reuse, I was amazed to learn that some HP products reused 98% of their code, think about how much money those guys save. You see I was used to do everything from scratch, I just wanted full credit for my work, I even worked alone, yup, I had a lot to learn.

The dramatic change
I realized I needed to work in teams to get things done, I had failed a couple of times before for working alone. So I built a team and joined a bootcamp called «Geek Fantasy Camp», I didn't sleep in three days but It all paid off when my team along with 8 other won tickets to Silicon Valley for a whole month. For the sake of this article, I'm going to ignore the uncontainable desire of writing 20 paragraphs about how life-changing that month was. The important thing is that I learned more than I will probably ever learn in a month again.

One of the things I realized I had wrong was my working process, to be specific, not using a framework.

So, I was actually already using jQuery by then but I'm talking about a full-stack framework. I realized everyone used one, so I started asking people, and wondered «How come all these incredibly smart people use so much code that they didn't even make!» The answer clearly was just that: They were smart enough to do so.

You probably know this already, but for me it was amazingly life-changing, I was actually building the tools to build something instead of using well-crafted, fully-tested ones.

So It had to happen and I stumbled upon Ruby on Rails, and I did research a lot on what framework to use (you know with full stack frameworks, it's like beyonce's song: If you like it put a ring on it. You sort of have to marry one to get the best out of it).

Ruby on Rails just blew my mind, I couldn't believe the time I was saving. And the best of all was that I was able to pull people to my projects and they would understand the code in a couple of days thanks to everything that Ruby on Rails forces you to do, Use RESTful architecture, DRY your code almost completely, god I even learned Sass and Coffee script on top of Rails in one day (If you don't know Coffee script or Sass GOOGLE THAT SHIT NOW).

Now, just in case you dont know anything about Ruby on Rails. Ruby on Rails is a full-stack framework which runs in the Ruby language and works in the MVC (Model View Controller) structure. It is probably the fastest way to deploy safe app with full functionality. If you are into entrepreneurship and the Lean Startup movement then use it, it's amazing to get a prototype running with no cost thanks to it's scaffolding awesomeness.

Like for creating a blog from scratch in 10 minutes:


Ruby on Rails also provides you with user-created plugins called «Gems», which magically work perfectly with your app thanks to the fact every app in rails looks almost the same in it's core.

Also, for those who think Rails isn't scalable, just look at Twitter, Github, Basecamp and so many others. A framework by itself isn't scalable by it's own, it's what you build with it that needs to be optimized, but trust me, if you are worried about scalability ask yourself the following: How many sites you have made have reached as much users as to care about scalability? The problem when starting a site isn't scalability, it is making something that hopefully has enough users for you to worry about it. And trust me, if that ever happens, your code will be clean and tidy enough to be optimized for scaling, just as Twitter again.

Now I'm not telling you to just drop what you have and move to Rails, Rails is awesome but there are other great frameworks out there. It just depends on what do you want to do, there are plenty of them to choose from.

Now, in case you are actually in the position I was (not using a framework), Just give them a try, I learned the hard way. It feels so good to spend half of the time and earn the same money with your work.

Hope you enjoyed my enthusiastic post, I really hope I help people that are on the position I was.

Best regards,
Rafael.

2 comments

jviaches
Actually it is one of those inspiring posts which make you energized with authors energy! Dispite of fact that i come from C#/WPF, this article made me to take a look regarding Ruby On Rails!

Thanks for your post Rafael, keep climbing in your «art»!
Narzerus
Thanks, I'm glad to help :)

Add comment