Much was made last week over the topic of micro optimization in PHP. Most of these argued that micro optimization was a bad idea, from the perspective of unit testing, the idea that “premature optimization is the root of all evil”, the fact that it takes too much time, and that it violates the rules of development and optimizaton.
There’s another reason that micro optimization can be a bad choice: it makes code absolutely impossible to read!
The original article by Alex Netkachov makes arguments about calling static methods, using magic methods, getting the time with $_SERVER[‘REQUEST_TIME’], output buffering, and loops. But what this article completely misses is that many of these tips would render code completely useless if you had to maintain it.
Thursday, March 26th, 2009 @ 8:32 am |
Comment (20) |
Categories: Best Practices, System Architecture, Debugging, Business Management
Tags: optimization, PHP