There is lots to listen on the PHP channel nowadays. Bashing, bashing; sometimes praise, and then some more bashing. This post is more of a justification to myself, especially after reading all these posts, about how PHP still works and how as a Web developer I cannot avoid it.
Programming and Templating
It all becomes too controversial till you realize that PHP is being talked about from two different angles – as a programming language and as a templating language.
Only a programmer who is passionate about writing good code can spend time in bashing a programming language. By good code we mean predictable, consistent, maintainable code. PHP, as a language does make it difficult to write it. You have to take an extra effort to avoid the pitfalls, absorb the shocks or the surprises and take in the inconsistencies. I can identify with this. I like good design, good code and PHP will not be my choice if I want to deliver that.
Unfortunately, this ease of use creates difficulties as project evolves. The templating langauge starts to crack, you start to look for more engineered solutions to complex problems. If you stick with the inexpensive resources you had, you end up with horrible unmaintainable sphagetti code. If you go to hire better programmers you have to go for more than better because using PHP now involves working through the programming language problems in addition to the previous avatar of your sphagetti code. PHP starts to suck.
A lot of PHP projects go through this. But a lot of these PHP projects are also successful. PHP, as a programming language makes it difficult, but it also makes it easy on a lot of other fronts. PHP sucks, but some people continue to deliver good code and good design with it. Success makes it addictive and it doesn’t matter any more if PHP is a bad programming language. Meanwhile some of us keep bashing PHP, venting out the frustrations, hoping that we will get to work with a better PHP someday.