You are currently browsing the monthly archive for February 2007.
I downloaded the WordPress codebase the other day and I’ve been browsing through it. I’d like to contribute to the project, since I use it myself and am starting to encourage others to do so as well. I don’t really know where to start, but documentation and simple refactorings seem to be a good start.
Here are a few suggestions that I’ve been able to think of while browsing. Some of them are purely style-based (I’m dreading hostile responses from the Big Ball Of Mud natives), but I’d like to clean up the code without actually changing anything.
I love RAII. Unfortunately, most popular enterprisey languages don’t support it. I’ve seen people claim that Java’s
finally is essentially RAII, but that’s not quite right. I hate seeing try/catch/finally scattered throughout application code.
One thing I definitely haven’t seen is any mention of RAII in PHP. Nasty ugly weak PHP that’s fallen out of favor with the hip. I can’t possibly be the only persion to have thought about this, because one of the bugfixes in PHP 5.2 is properly ordered destructors. However, since most people aren’t developing for PHP 5.2, I suppose it’s not a surprise that the subject isn’t googleable. Anyhow, prior to PHP 5.2, objects in the same scope would be destructed in arbitrary scope (usually the order in which they were declared, which sounds backwards), so multiple resources acquired in one function couldn’t be interdependent without invoking undefined behavior. That’s bad, but it’s not a show-stopper.