1 Introduction
This chapter covers
- What makes PHP an efficient, adaptable, and popular language
- Exploring why mistakes can be easy to make in PHP
- Exploring some common types of mistakes
PHP is one of the best programming languages to begin the journey as a web application developer. The most basic website can be referred to as a static website, generally composed of HTML, CSS, and some JavaScript. By adding a server-side language like PHP, we can make the content more dynamic and better control the content without always needing to modify the HTML code. PHP’s syntax is easy to adopt, and the tooling is free. These factors have made it the most popular web programming language across the internet, and many free hosting platforms can be used to publish a PHP website.
That said, it is important to note that PHP’s syntax is relatively easy to pick up on, and many fundamental programming concepts are not enforced. Although this makes it an excellent selection for beginners, it can also be a potential nightmare for bigger projects. Given how easy it is to do certain things, we risk introducing code smells without following best practices.
A code smell can be seen as a blip in application code that can be traced back to poor or misguided programming practices. In other words, when we need to adhere to certain best practices and standards. Code Smells can inhibit one’s ability to extend code and scale an application in the future. We want to be able to detect these as early as possible.