Is Rails suffering the same problems as PHP?

I know that mentioning Rails and PHP in the same sentence is taboo and can incite many flame wars. But hear me out — Some say one of the “downfalls” of PHP is that its so easy to write applications and just about anybody can write a PHP if they put their mind to it and learn the syntax. As a result, PHP Applications have a long history of badly written, insecure code and has really been shunned by many advanced developers (aside from many poorly named methods, I think PHP is alright!).

In recent months I’ve been recruiting for a Rails Developer at my company, in Chicago. I did a phone interview and the guy couldn’t name me any rails sites he reads, or name the 7 rest actions, or even tell me what version(s) he uses. Now, I’m not claiming to be an expert, but I would think that even an average Rails developer would know that.

I’ve also seen code where the developer doesn’t quite get MVC. You don’t need to be validating values in your controller and adding error messages to @model.errors.add for example. You don’t need to be setting up display labels in your model. You don’t need to be counting things in a helper method. I was thinking, why is it so hard? Is it because in mostlanguages we have had free reign to interpret MVC however we pleased? I know I spent many years in PHP trying to develop a DAO. I made an object that returned a row of data, with methods to access the fields. But what about a collection? what is that? I experimented with an array of objects but I felt that was too wasteful. Iexperimented with a DaoSet that was made to hold a collection — complete with iterators! I even struggled with MVC and knowing what went where…when I saw Rails it was like someone who met their true love — this is it!

After experiencing Rails, I realized hey I can do some of this in PHP! I wrote a simple MVC framework in PHP. I called it StupidlyEasyMVC Framework. I was able to use it at work (at the time, I was still at a PHP job. Some say I talk about that time in my life as if it were a prison sentence haha). SO I was able to apply things I learned from Rails, into an existing structure at work. Just like the guy from CDBaby — I couldn’t drop my existing PHP site and just start converting to Rails, but by starting to gradually switch from what I had to an MVC structure, it made my code cleaner and easier to work with.

So as I look for advanced rails developers, I find they are far and few between. Either they are hotshot consultants or working on their own startup. What makes a rails programmer “get it” and really work with the framework instead of against it - still trying to write as they always have?

Here are some things you can do if you feel you are still writing PHP or .NET code in rails..

Get a project. You can read and dabble all you want, but if you don’t have a project, you won’t be forced to learn. Along with that, you need a timeline to force you to keep at it!

Watch all the Peepcodes! especially the REST and rspec episodes. I’ve search hard and long enough for answers, to find comprehensive training in ONE spot, in such an easy to learn format is awesome. I constantly talk about peepcode and I won’t work with anyone who hasn’t watch them.

Peepcode Code Review - their first book, full of helpful hints and gotchas that will really help you move beyond a beginning developer

Ruby Inside Blog - www.rubyinside.com

Jay Fields - http://blog.jayfields.com/

Obie Fernandez - obiefernandez.com

Books:
Agile Web Development with Rails - If you are doing Rails and don’t have this book, get it! It is the bible of rails! I don’t care if you have the first edition already, this will save you time!
The Ruby Way by Hal Fulton - because if you don’t know ruby, you will never be a good rails developer.
The Rails Way by Obie Fernandez - its good because I tech edited it before publication! It is a comprehensive instructional and reference book — all in one. I cannot wait to get my hands on a paper copy of this to keep at home and one for work. (just got one this week…I’m ecstatic)

Well this has been mostly a rant but hopefully a help resource to move into more advanced development of rails. If you have other insights into this problem or suggestions for how to improve, please leave a comment!

3 Comments »

  1. Peter Harkins Said,

    December 10, 2007 @ 8:30 am

    I only have two questions that I’ll always ask in an interview. The first one is, “How do you keep up-to-date?” I don’t care if they read books or blogs, visit conferences, or hang out on mailing lists — as long as they have some interest in and plan to always be learning. With the second one, I wait for to hear about something they like and know well and ask, “And what do you dislike about it?” If they have an answer, it shows they’re able to introspect and analyze things, to compare and judge solutions. Because programming is about solving problems and weighing trade-offs, I want to know that candidates are continually adding to their toolbox and know how to choose the right tool when the time comes.

    These are pretty fundamental things. For Rails specifically? I dunno, I’d like to know that the person knows some HTTP, rather than “The user clicks a link, insert magic here, my HTML appears…” I’d also want to know that they understand Ruby’s open classes so they get how plugins work and could write their own.

    (BTW, I think posting comments here is broken unless you send a referer. “This page cannot be used alone.”)

  2. S. Potter Said,

    February 9, 2008 @ 9:01 am

    I think you have hit the nail on the head: “Some say one of the “downfalls” of PHP is that its so easy to write applications and just about anybody can write a PHP if they put their mind to it and learn the syntax.”

    I totally agree. It isn’t people that write good PHP I am against, but if more than 95% (ok, I pulled that number out of thin air) of people that write PHP are just plainly bad at software development generally, I do steer clear of people with *just* PHP experience unless they can converse intelligently (in a fair and balanced way - unless they are indulging my elitist snobbery for fun and games) about software development on the whole. I am also super weary of the “agile” clones that repeat the same things about being “agile”. They are VERY good at talking the talk, but…. they aren’t fair and balanced (or they are “fair and balanced” like Fox News).

    One thing you have also gotten spot-on is the “syntax” part of that statement (at least I suspect this is what you were getting at, reading between the lines).

    People invest too much time in learning *just* the syntax, where understanding the philosophy of a language/environment/framework is far more important. I laugh when I am in interviews and they ask me to write syntax on the board (and complain when I forget to put semi-colons or other little things) instead of asking me about my approach to problems and my reasoning for the approach given the context, whether code- or higher-level. Of course, asking about commonly used APIs is gauge a person’s experience, but often I find the best developers don’t learn APIs verbatim, instead they keep the Javadoc, RDoc, Pydoc, etc. up in a web browser for reference. The questions you asked the candidate here, however, are VERY basic, so I would definitely keep those as initial questions to gauge their level on an initial phone interview!

    One suggestion I have (if you aren’t already doing this), is to seek specifically Ruby developers that were on the scene before Rails that might have some Rails experience.

  3. Sean Said,

    May 5, 2008 @ 1:58 pm

    I have never used Ruby on Rails, I am not even sure what it is, I know its a framework to use Ajax of sorts but I have never sat and looked at the code. I will say that I am a PHP programmer and have programmed many things with it, but to say it is easy is like saying auto mechanics is easy. Working on PHP is easy, but anybody with a knowledge of C++ or even Visual BASIC can easily learn the syntax. It is like that with any language though, I could easily pick up C++ because I knew Javascript and before Javascript I knew QBasic. They are all the same, just different syntax.

RSS feed for comments on this post · TrackBack URI

Leave a Comment