PHP is a bad programming language

May 20, 2011

Recently I was having a discussion with a friend who insisted PHP is a bad programming language. His main argument was that PHP makes it easy for crappy programmers to write crappy code, therefore PHP is a bad programming language. I will admit, crappy programmers can write crappy code in PHP - but that does not make it a valid metric for comparing languages. In fact, crappy programmers can write crappy code in ANY language.

Lets take a look at C - an old and well respected programming language. While it is indeed very fast, the amount of built in functions are minimal. In PHP, if I want to sort an array, I can simply call the sort() function and it will use a fairly optimal and non-intuitive sorting algorithm, quick sort which runs in O(n*log n) time. Where as a crappy C programmer might write a more intuitive sorting algorithm, selection sort, which yields a O(n2) time. Therefore C is a crappy programming language because the programmer wrote a crappier algorithm. Or is it that C is a better programming language because it makes it hard for crappy programmers to write bad code?

What about automobiles? Cars make it really easy for crappy drivers to get into accidents. Thus driving an automobile is a bad mode of transportation.

What it really comes down to, is that people use the best tool for the job.