I’ve always been a huge open source software proponent– this blog is ran by FreeBSD, PHP, WordPress, Apache, MySQL, etc., yet the PHP language has never really sat well with me. It’s always reminded me way too much of a derivative of C for the web, becoming more C++ like with it’s carnation of “Object Oriented Programming” introduced in PHP 5. I really tried to like it long ago back when it was still being called “Personal Homepage” or whatever, but it just never really congealed for me. Granted there are a great number of open source PHP projects that I will continue to use until something better comes along, but I’m glad my income is not dependent on writing PHP. I dabble in it every now and then specifically for this site, but eh…
So on to what inspired this post… A couple of days ago I was looking up something on Wikipedia and was presented with this error message (click to enlarge):
Not that it’s necessarily a good empirical reason to not like PHP, but it certainly does make the baby Jesus cry (much like Perl does). Granted you can write bad code in any language, but wow. If you’ve ever even tried to install the MediaWiki software, you probably have an idea what this codebase is like.
I think my favorite part of the code that my co-worker pointed out is the LoadBalancer.php file listed in the trace. I assumed loadbalancing was already built-in to PHP with functions like loadbalance_on_linux_with_apache(), send_load_to_array(), or cache_connection_to_mysql(), but I guess not, so it needed to be implemented into the MediaWiki code base.