Even the best of us can only write 1,500 lines of code a day, so we need to make those lines count.
There were so many great articles in PHP Advent this year, I couldn’t think of a good topic — I like to believe my peers stole all the good ideas. :-)
A decade of PHPThis Advent marks the day I’ve been a professional PHP programmer for a decade. Ten years ago, I was consulting for a startup consisting mostly of Asians, which meant a lot of smoke breaks. During one of those particular breaks, a programmer asked me, “Hey, Terry, have you heard of PHP?”
“No, what’s that? Some new designer drug?”
“Haha! No, it’s a web language like ASP 1, but it’s free. You should check it out; you might like it more than Perl.”
Instead of smoking a pack of this in honor of that day, let’s begin with some startup stories spanning that decade.
The John Henry of C++A few startups ago, I worked with a guy who was a better programmer than you.
One day, we got into an argument over a piece of open source import code — written in Python — that he had ported to C++. He had just finished telling me how much faster he had made it, when I asked, “What’s the point in that? Now that you’ve rewritten it, you own the maintenance of it. (Stoyan would disagree.) There is no evidence this code is even the bottleneck.” 2
The point? The code was crap, and he had fixed it — the massive improvement in efficiency was an added bonus.
“Look you’re right. It’s true I prefer to use a crappy, ugly, underperformant language like PHP, and you crank out C++ like John Henry drives steel. But, while you’re busting code with a hammer in each hand, I’m the guy with the steam-powered jackhammer. Sure, you win, but your heart will burst, and you’ll die.”
“And here’s the thing,” I added with a devilish grin, “There’s only one you; there are a lot of people like me out there.”
1,500 lines of code a dayThat philosophy started out with an observation I made while being the director of engineering at an earlier startup. It was the kind of startup that all programmers have to cut their teeth on at some point — the kind where you, like Laura, have to put in 170-hour weeks and program uphill both ways.
— Who would have thought 10 years ago that I’d be writing a PHP Advent article drinking Château d’chatalé?
Although I did not actually put in 170-hour weeks 3, I did sleep under my desk. I also didn’t program uphill both ways, but I did spend my days programming and my nights integrating all my engineers’ daily commits. It was during this nightly integration that I made a startling observation. No matter what the programming language, no engineer — including myself — wrote more than about 1,500 lines of code a day.
This observation affected my engineering judgements and decisions for the next decade. It is a maxim I live by today. If we can only write 1,500 lines of code a day, then a quarter of a million lines of code takes about a year. If we can only write 1,500 lines of code, we had better choose the right language and use it in the best way to maximize the expression of our creativity.
When I told this to a friend, he added, “1,500 lines a day… except in Java. J2EE programmers only write
Truncated by Planet PHP, read more at the original (another 35795 bytes)