Hacker News new | ask | show | jobs
by nocipher 5193 days ago
I spend a lot of my time writing Python, especially for Django powered sites, and writing client side javascript. Periodically, I'll get stuck maintaining large projects written entirely in PHP and miss the nice features from other languages. Javascript has its bug-a-boos, but with its dynamic design and jQuery, its easy to write clean code. Python is also much cleaner and usually just works.

On the other hand, all of my programming horror stories and terrible hacks have been written in PHP. I remember having to use an older version of PHP that failed to support closures when it was needed in some legacy code. The code was passing functions as arguments, but because the functions were not bound in the local scope, there were issues with namespace collisions. I had to resort to global variables for a situation that should not have needed it because rewriting everything properly required a non-trivial refactoring that I did not have the time to complete. Granted, this has been addressed in more recent versions of PHP, but there are always old versions floating around where "gotcha's" like this show up.

More recently, I ran into an issue porting PHP 5 code across different linux distributions where, for some strange reason, libraries on the include path failed to be found. Debugging something like that is ridiculously frustrating. Problems like this are bound to show up with any technology you use frequently, but my work involves using many languages and technologies and, of them, PHP is the only one that leads to these sorts of problems with such regularity.