Skip to main content

Learn PHP Without Going Mad


(c) Ian Baker (2012)


PHP, the language which runs 80% of the known internet, is renowned for its fundamentally poor design. The language began as a few little functions letting non-programmers manage rudimentary web forms. But it has expanded into the 7th most popular language there is, a very fast, mature object-oriented thing which tries hard to manage its primary burden: itself. (Much of the horror has been patched over since PHP5, I am told by grizzled veterans.) The lead dev at my work, who's spent 10 years with it, admits that it "keeps you on your toes". (However, one would prefer that one's tools were transparent, an extension of the arm.)

Neal Stephenson notes that source code comments (the backstage cribs of your software)
read like the terse mutterings of pilots wrestling with the controls of damaged airplanes. The general feel is of a thousand monumental but obscure struggles seen in the stop-action light of a strobe.
This struggle is the spirit of the PHP community: stoical mutual aid in the face of a great external force. Even better, there's a large disgruntled demographic who have written hundreds and hundreds of 'PHP sucks' articles; perversely, this is actually a very good thing for PHP - since the best way to learn something hard is through satire and clear-sighted criticism.

Six ways to learn PHP without hating everything:


1. THROUGH STOICISM



2. THROUGH SADNESS and RAGE



3. THROUGH OTHERS' MISTAKES



4. THROUGH HACKING



5. BY NOT LEARNING PHP
(That is, use a nice opaque PHP framework from the start.)
  • For instance, Laravel is such a thick wrapper that you can forget you're writing PHP at all. (Needless to say this has costs.)



6. BY REFERENCE TO OTHER LANGUAGES



7. BY ANALOGY
  • "PHP is the Nickelback of programming languages"
  • "PHP is the Orc of programming languages. Ugly. Doesn't respect the rules. A big headache to a lot of people who manage them. But still dominates most of the Middle Earth."
  • "PHP is your teenage sweetheart, the girl you first awkwardly fumbled around with that one summer. Think twice about a more serious relationship though - this girl has serious issues."
  • PHP is the Ford Pinto of programming languages (or, depending on who you ask, the Toyota Hilux).



Comments