PHP, a pragmatist's tool
6th August, 2020
When I first started in web development I couldn't decide which language to get into the deepest, where to devote my precious energies. As JavaScript is one of the basic building blocks of front-end web development I remained with JavaScript and learnt some trendy JavaScript frameworks and libraries like React and Node. Needless to say, I did not feel any remorse about my choice. However recently I have started working more with PHP so I decided to look into what is PHP and why it has a bad reputation among software developers in this blog post.
Let me point out at the beginning, I love PHP and I would never jump on the bandwagon to scold PHP just because so many software developers tend to do that even though I would also not say that PHP is perfect.
As shown in the title I am a pragmatist so I am looking to solve problems and achieve goals when using a programming language. PHP is just a tool at the end of the day and I found it a very versatile tool that affords itself to achieving your web development goals relatively effortlessly and quickly.
PHP is in fact a very popular choice on the internet and popular Content Management Systems and frameworks are built on it like Wordpress, Drupal and Laravel.
So what is exactly PHP?
PHP is an open source, server side, general purpose scripting language that was brought to life first in 1994 by its creator Rasmus Lerdorf. PHP stood for Personal Home Page at the time but later it stood for the recursive initialism PHP: Hypertext Preprocessor.
PHP was developed organically, its creator did not plan originally to create a new programming language. As Lerdorf stated it later: "I don't know how to stop it, there was never any intent to write a programming language [...] I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way." He used PHP originally on his personal homepage and extended its implementation to work with web forms and communicate with databases.
Due to this organic nature of PHP it can be said that PHP is not the most perfectly designed programming language. That is one of the reasons why some programmers don't like the language.
Programmers who dislike PHP usually complain of features like problems with error handling, inconsistencies with function naming and occasional contradictions with order of arguments.
An other reason of the disdain is that historically it was easy to get started with the language so that many beginners and programmers with less experience dabbled with the language often making a lot of mistakes.
Let's face it there is still a lot of gatekeeping in software development and some developers are just elitist and don't like a tool that makes web development so easily approachable. One thing that I love about PHP is that it is easy to pick up and use it in an effective way.
One other reason PHP is a good tool to choose is that it famously cares about compatibility with earlier versions so it can be a safe choice for any enterprise that develops an online system. You can be certain that in 10 years time your system will still work.
Nevertheless, PHP as any tool, can be used in skilful, elegant ways and in skill-less, error-prone manners.
It is also needs to be stated that today's PHP is much different from the early versions of PHP as it developed greatly along the way. One feature that PHP gained in the past years is its object-oriented aspects. It is definitely possible to consistently code with PHP in a well-tested, well-documented manner using modern clean programming methodologies.
It is certain PHP is here to stay given it's widespread usage and I don't attempt less than to use it with craftswoman like good practices complementing my JavaScript skills.
