I've recently picked back up a small project I had to put down for a, um, more regular paycheck, and the owner had hired another programmer to hack on it for a while, which is fine except that he didn't involve me when he did it. No serious problem, but the new guy not only doesn't understand when to use UNIONs in his SQL, but also went hog wild with OO php. "When the only tool you have is a hammer..."

There's certainly nothing wrong with OO php. It's often The Right Thing to use, and makes MVC a lot easier to set up my old skool $myrow['fieldName'] calls in the page creation code. For me, a gvim user, I just prefer to keep it all in the recordset, ASP style. I usually separate larger pages into "engine" files/includes that create the dynamic html or at least set up variables to spit into the page, which is close to the same thing as moving the SQL into an object.

But OO php + old skool php == one f'n mess. At times, the temp dude wrote a few lines into my old code, or wacked the SQL into something that's hardly normalized, and for others he wrote brand new OO code and replaced a page or two at random. It's a real amalgam of style now, without any docs explaining the changes, and is a real b!tch to debug.

Now I could probably be convinced to go to OO if my tools were OO savvy. PHPStorm, a crossplatform Java editor for PHP, seems to do code completion based on your own objects, Visual Studio style. That's pretty kewl, and much easier than typing it all in by hand with VIm.

Why can't we have a good JTextPane extended with VIm shortcuts? Honestly, I'm more than sold on VIm (and have tried some VIm code completion extensions with varying degrees of FAIL). Not using the mouse means you're faster. Perhaps I should give PHPStorm a shot. I don't do large Java projects in VIm, for instance. I use Eclipse. I love using Visual Studio for C# and VB. At some point, I guess there will be a good enough editor to pull me away from VIm for php too...

Labels: , ,