Joel Moss (a fellow member of the CakePHP community) has been acting like a bit of a Rails (and Ruby) fanboi as of late. He’s doing a series of blog posts proclaiming his love for Ruby. Personally, I loved Rails when I first encountered it. Played around with it. Wrote a web site for my simulation baseball league in it. Then started disliking *some* of the people in the community and are now pretty much ambivalent about Ruby and Rails in general. Great tool, not for me. Python seems to be a better fit for me at least.
I think a lot of what he says is nonsense and can be summarized with “I don’t like PHP’s syntax.” Hell, I don’t even like it myself. PHP’s big problem has been consistency with parameter order and a less-than-stellar object implementation. Yes, things have improved in terms of OOP (closures and traits!) but PHP clings hard to it’s procedural roots and that is not necessarily a bad thing. Slamming PHP for it’s OO implementation is like picking at a scab so it never goes away. Pointless. “PHP sucks because of bad syntax” is an argument I’d expect from my 9 year-old daughter, not a good programmer like Joel. Kind of disappointing. Never mind all the awesome built-in functions or wealth of high-quality third-party libraries out there for PHP. Sure, those things exist for Ruby too but often you only have one or two choices. PHP is absolutely rich in choices of third-party libraries. Sure, a lot of them are not top quality but it never takes long to figure that out. Okay, I’m drifting. On to the rest of my point.
I think where Joel starts to go off the rails was a follow-up in Twitter that said “Hands up if you’re a lazy developer. [I proudly hold both my hands up high in the sky] Laziness makes me a better coder http://bit.ly/MKFQe”. Once and for all, we need to stamp out the “laziness makes me a better coder” meme that is picking up steam. There is a HUGE difference between laziness defined as “I want to write less code” and laziness defined as “I don’t want to have to figure shit out.”. The first one is called efficiency, not laziness. The second one is the type of trait that a programmer should be ashamed to have.
I realize now that reliance on the use of frameworks for your applications is the type of laziness that is straying from efficiency to pure laziness. Before you get all riled up, hear (read?) me out. When you use a framework, you are accepting that it will be abstracting a lot of functionality away. Functionality that you might not even understand correctly. Which is great for quickly building something, but bad when you run into an error being generated by the framework itself. Or behaviour that is unexpected. I like to call this “fighting against the conventions”, and I believe that is the #1 reason why people end up not using a particular framework. They cannot or are unwilling to follow the conventions and as a result, nothing will work.
So, if you use a framework all the time, you might find that certain skills or bits of knowledge start to erode. Use an ORM all the time? You forget how to make finely tuned SQL queries. Rely on built-in form validation? You start to forget what POST requests look like. Use the Ajax helper that comes with the framework? You forget how to make tight, customized Javascript code. I think you’re starting to get the point.
Joel is 100% correct when he talks about that there are features in Ruby that allow you to be more EFFICIENT with your code than in PHP. That is not laziness. Usually when a developer calls themselves lazy, it is a self-deprecating statement. I have called myself “lazy” because I strive to write as little code as possible to accomplish a task. That’s not laziness, that’s efficiency.
The use of the term “laziness in terms of coding” is just a bad one to use. Use the proper term, which is “efficiency in terms of coding”. “Laziness in terms of coding” is cut-and-pasting code all over the place, or blind use of code examples you find on the web without understanding what they really do.
Joel, I’m happy that you are loving Ruby. Python gives me the same fuzzy glow on those occasions when I play around with it. But please put things in the proper prospective. To paraphrase the Princess Bride: “You keep using that word. I do not think it means what you think it means.”
Tags: CakePHP, efficiency, frameworks, lazy developers, rails, Ruby

Well that put me firmly in my place didn’t it?!
But you are right about being lazy. Being lazy to me, simply means I want to write as little code as possible in order to save me time. I know what I mean.
You are also right that I don’t like PHP’s syntax. In fact, the more I use Ruby, the more I get annoyed at PHP and its idiosyncrosies. (yeah I know I spelt that wrong). But please remember that my blog post was only reason #1 of 10, about why I prefer Ruby over PHP. And none of those reasons are likely to include talk about PHP’s good points – which there are plenty of by the way.
Anyway, whats wrong with being a fan boi? People always use that term in a negative way. I’m also a Jason Mraz fanboi, and a Lost fan boi. Is that bad?
WOW, take the gloves off. Anyway, thanks Chris for the blog. I am new to CakePHP and I choose it over Zend because my “laziness” made me hate spending more time with configuring then programming. I have looked at Rails and was thinking of learning it, but your info makes me feel better that I can use what I know and CakePHP to be a better programmer.
[...] one last thing before I start reason #2. I want to say thanks to Chris Hartjes for his blog post earlier today. I made a comment on Twitter about lazy coders, being good coders, and he basically [...]
Really off-topic I know, but I really like your blog’s new design, well done Chris.
Allow me to respectfully disagree with you here Chris.
Pointless. “PHP sucks because of bad syntax” is an argument I’d expect from my 9 year-old daughter, not a good programmer like Joel.
————————————
We’re talking about languages here right? So a lot of the argument is going to be centered around syntax, and the tools it provides you to do the most while writing the least amount of code …. no?
I mean, what else could you center on to criticize.
Sure, those things exist for Ruby too but often you only have one or two choices. PHP is absolutely rich in choices of third-party libraries.
————————————-
Ruby is a multipurpose scripting language so the libraries for just Ruby tend to be limited. But if you go into web development, and pull Rails into the shootout, then this statement no longer holds true.
The amount of well written (and tested) plugins/gems for Rails is simply astounding.
@austin_web_developer
Correct me if I’m wrong, but aren’t you confusing tools with the language itself? Some would argue that Rails is nothing but a monkey-patched DSL that sits on top of Ruby. Whereas Ruby the *language* is certainly elegant, Rails is full of so much magic that I wonder if people really understand what is going on under the hood. I know he’s not the most popular guy, but I really think that Zed Shaw’s belief of looking at the source code of the tools you use is a very valuable experiment. Obviously this is not possible for some things (i.e. I don’t know if looking at the source code for Vim is going to convince me to use it) but if the Rails fanbois looked at Rails itself they might be surprised at what they find. I’m willing to bet that it’s not perfect. No framework is.
If you separate Rails from Ruby, then I think that you correct in stating that syntax of Ruby vs. that of PHP is a win for Ruby.
Add Rails to the equation and I don’t think it’s the overwhelming victory that it’s advocates would like to claim it is. I think it’s a draw now because while Rails had a big lead at one point, other frameworks in different languages have caught them and Rails might get passed by if they aren’t careful.
What is there to really choose between Rails and Django and CakePHP? All three promote the idea of rapid application development. All three use variations of the MVC design pattern. If a person’s argument against using something like CakePHP is “PHP’s syntax sux”, then I start to question their judgement.
Anyway, maybe i was rambling a bit there.
Lazy people have the right not to have their thunder stolen.
I agree with Chris, and yes I use Cake. But for another reason written here. All my clients expect me to work in PHP. And most of my new clients do. So using a framework like CodeIgniter for the first time would be as easy for them as for me. Starting to use RoR for it’s syntax, wouldn’t make sense to me…as a freelancer that would ruin my career.