Computers process information differently than humans do. Anyone who's first learning to program understands this well. What's hard about programming for a beginner isn't really big hard esoteric concepts, but that you've got to be so painfully exacting in how you describe everything to a (dumb) computer. That's why we do rubber duck debugging.
This is the second in a series detailing what I consider "Thoughtful Code." In the first one, I highlighted the high-level overview of what I consider "good" code, here I'm going to go (a lot) deeper into what this overarching framework means in its specific components. Well one of it's components. Specifically, the context in which our code lives, and how that shapes our definition of code quality.
I've been thinking a lot lately about what makes code "good." Let's take it for granted that "good" is so meaninglessly subjective that it's not really a useful term for one to use when talking about a program or block of code. So let's say that "thoughtful code" is code that meets my personal subjective definition of "good." But before you zone out, I want you to know that a lot of "bad" code is actually "good" and vice-versa. The counter-intuitive reality is that WordPress contains some of the best PHP code on the planet. Let me explain why…
One of the topics of seemingly perennial discussion among programmers is whether object-relational mapping (often abbreviated to ORM) is evil or not. Opinions seem to run the gamut from "I use and love it" to "I tried it once and never will again." And you often encounter at least a few "what are you talking about?"s.
I've given the talk "Banishing Loops with Functional PHP" (or "Functional Programming, it just depends on how I titled it) at least three times. But it's still, mostly a talk. You can watch a talk I've given many times right here:
Recently (at the end of 2017), OWASP updated its Top 10 list. For the unfamiliar, let me briefly explain what that means: the industry standard of basic-web-security education has altered. Though it's never been a complete security education, the OWASP Top Ten is where almost all standards for web-developer security education begin. So when it changes, that's kind of important.
Let's get it out of the way early: PHP is a strange and ugly language. It's not exceptionally fast. It's not beautiful syntactically. It's not formulated around a clear opinion about good software development practices. And it's still what I write a lot of software in. The obvious question is: why? Why use PHP today?
It's easy to think about programming as an exercise of computers, or of languages and design. But at its heart programming is just about people. I bring this up because it's so easy to lose sight of the fact that people are who you're really programming for, and I just need a reminder sometimes. Maybe you do too.