January 10th, 2013

Ctrl+Alt+Del - Scott & Ted

Consistency is key; Optimizing the wrong things

A lot of people like to claim that PHP is just slightly off in so many little ways it's hard to fully quantify why it's so bad in a convincing enough manner. I typically ignore this because every language has its inconsistencies, and the ones often picked on really are trivial, even in sum. Also, quite often people will say "PHP has X and Y inconsistent, yet [Language A] doesn't" and then follow up with "PHP has M and O inconsistent, yet [Language B] doesn't", yet where they fail is that [Language A] has M and O inconsistent while [Language B] has X and Y inconsistent (swap the language inconsistencies), or places where both [Language A] and [Language B] are inconsistent yet PHP isn't. Yes, plenty of little things are inconsistent if you look hard enough.

And then I find people who are making really bone-headed stupid coding standards in PHP and then I want to bash some heads in for giving PHP a bad name by their voluntary actions. Hard to read coding standards (No spaces between operators or anything? Are you serious?), inconsistent structuring (one line has 2 arguments, the next 3, the next 1, then next 2... recipe for hard to read code), inefficient designs (a constructor just to pass the __CLASS__ constant to the parent constructor? Seriously?), verbose nearly identical commands (if your class extensions recommend a code generator then there's something wrong...). So many little things quickly add up to something I cringe to think about, much less touch. Tout efficiency if you want, but that just screams incompetence and lack of true clarity to what makes things efficient (Minimizing the number of times you press the space bar is not efficiency!).

If you can tell which framework I'm talking about and want to defend it, don't bother. If you can't tell then be glad and I hope you never can. If you can tell and wish you couldn't then you have my sympathy.
Ctrl+Alt+Del - Scott & Ted

Thoughts too short to post... (Tweets)

  • 00:59 I won't be impressed if the sample code in your framework tutorial looks like a monkey wrote it. Stop torturing me with unreadable code.
  • 01:11 Seriously. No spaces? Inconsistent wrapping? Prefixing database tables with 'tbl'? Class generators for what shouldn't need need any?
  • 08:17 Prime example of why [System] Hungarian Notation is bad in PHP: $hUname = posix_uname();
  • 10:22 If I were a theatre major then right now I would be dramatizing "Did they (dramatic) pour it, or did they (smooth) pour it?" Barista.
  • 10:41 Don't judge. Like you've never scoped out coworkers at a new job to see who is attrative and wonder who they are. >_>
  • 22:27 If we tell people not to create their own cryptography, why don't we tell them not to create their own framework or coding standard?
  • 22:39 Or template engine, or CMS, or ... etc etc etc. I say this of the people that have no experience creating or working on any of these.
  • 22:41 Also, "overpowered" is a poor reason not to use a library or framework. 'find' can do way more than most use it for, but we still use it.