The language has a substantial stake in Web development, but it is marred by design flaws PHP, the venerable server-side scripting language, is famous for its use in Web development. First released in 1995 by Rasmus Lerdorf, it has been leveraged by the likes of WordPress and Facebook and reportedly is used in 82 percent of websites whose server-side programming language is known, according to W3Techs. The language is slightly behind Java in the PyPL Popularity of Programming Language index, and it ranks sixth in the rival Tiobe index. A high-performing upgrade, PHP 7, is due in 2015. Like any technology, however, it has its devotees and bashers. Here’s why advocates swear by PHP and why some dissenters might swear at it. Good: It’s popular and easy to learn “PHP is by far the most popular Web development language,” says Andi Gutmans, CEO at PHP tools vendor Zend Technologies. Josh Lockhart, a Web developer at new Media Campaigns, as well as an author, emphasizes PHP’s small learning curve, ease of deployment, and fast development iteration. “PHP is one of the easiest and most accessible Web programming languages available,” Lockhart says. “It’s installed on a vast majority of servers (including most shared hosting plans). It’s relatively easy to learn thanks to excellent online documentation and up-to-date online resources.” Good: Jobs available for Web developers “PHP will help you make money and find a job,” on the server-side Web, Gutmans said. A quick search on the Dice.com technology jobs site last week found 3,366 jobs related to PHP. This pales in comparison to the 17,418 Java jobs and trails Perl (4,300 jobs) and Python (5,429 jobs), but it was more than Ruby (2,973 jobs) and even Objective-C (985 jobs). Lockhart sees PHP as one of the most frequently used languages, although it’s a bit less trendy than languages like Ruby, Python, Go, and Rust. Good: It continues to evolve The language boasts modern capabilities like closures and namespaces, as well as performance and modern frameworks. As Gutmans notes, “Some people who want to move away are not necessarily educated on what PHP has to offer.” Developers, Lockhart says, are recognizing that PHP is powerful with modern features and a proper object-oriented programming model. Coming up is version 7, set to offer dramatic performance improvements in applications. Lockhart notes Facebook’s enhancements for PHP, including the HHVM virtual machine and the Hack language. Bad: Complaints about design, lack of focus “Virtually every feature in PHP is broken somehow,” says blogger Eevee in “PHP: A fractal of bad design,” a 2012 missive against the language. Eevee goes thumbs-down on not only the language, but the framework and ecosystem as well. Rather than being predictable and consistent, the language is full of surprises and is inconsistent, according to the blogger. Among the criticisms, PHP is called opaque, with no stack traces by default, and saddled with complex weak typing “There’s no clear design philosophy. Early PHP was inspired by Perl; the huge stdlib with ‘out’ params is from C; the OO parts are designed like C++ and Java.” Lockhart acknowledges Eevee’s anti-PHO sermon as being “hyperbolic with a kernel of truth.” Although a PHP advocate, Lockhart was gracious enough to list criticisms when asked: The language is inconsistent, specifically function names and argument ordering. “This is easily learned, though, so it’s not a very big concern.” PHP still has a lot of legacy baggage, like globals, magic quotes, etc. “These bad practices are slowly being pruned from the language, but until they are gone, they help ignorant developers persist bad practices.” PHP is not as focused as other languages, which Lockhart attributes to its being developed “piecemeal over a long period of time, often by committee.” Related content feature 14 great preprocessors for developers who love to code Sometimes it seems like the rules of programming are designed to make coding a chore. Here are 14 ways preprocessors can help make software development fun again. By Peter Wayner Nov 18, 2024 10 mins Development Tools Software Development feature Designing the APIs that accidentally power businesses Well-designed APIs, even those often-neglected internal APIs, make developers more productive and businesses more agile. By Jean Yang Nov 18, 2024 6 mins APIs Software Development news Spin 3.0 supports polyglot development using Wasm components Fermyon’s open source framework for building server-side WebAssembly apps allows developers to compose apps from components created with different languages. By Paul Krill Nov 18, 2024 2 mins Microservices Serverless Computing Development Libraries and Frameworks news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos