(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.)1. THROUGH STOICISM
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:
- A solid, kind, unradical overview of the language, its community and the modern Way, by Josh Lockhart.
- A long and thoughtful intro, from fundamentals to responsive multimedia frameworks, + exercises, by Paul Hudson.
- Includes a spirited defence of its many upsides.
- Many clever mind-saving recipes.
- The comments on the official docs are often insightful, and the down-voting QA is rigorous.
- Learn these; you'll be seeing a lot of them.
- Dumb-ass non-transitive special-case truth tables.
- PHP code looks pretty bad at first - all those dollars and arrows. To cure yourself of this judgment, go read some Perl.
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.)
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).