TL;DR: Don’t avoid writing a kludge of code when the situation necessitates it. Sometimes, factors outside of our control dictate how quickly we can turn a solution around. At the minimum, leave a code comment that explains what the code does and optionally why it’s not included in a way that’s as consistent with the rest of the module in which you’re working.
When I first started in my career (as I imagine most people in our industry do), I was bent on writing the best solutions possible to the problems that I was given.
Nevermind that fact that I may not have had the experience of my peers, managers, or so on. I was bent on making sure that given the level of information I had, I was going to write the best code possible and aim to both prove myself but to show what I was capable of doing.
I was young. 🤷🏻♂️
Fast-forward over a decade, and things have changed.
But as both my family [and I] have grown and as WordPress has changed over the past half-decade (let alone decade), that entire perspective has changed.
For as long as I’ve been writing on this site, I’ve used a combination of syntax highlighting, GitHub gists, or code or pre tags to help share code relevant to a given post.
But the more technical articles I read and the more that I see we, as an entire industry, start to rely versus utilize tools of Stack Overflow and other sites, the more I wonder how much we really understand what we’re writing (or even care) so long as the end results just works.
This isn’t a commentary on how quickly we should ship something. Instead, it’s about how we solve a given problem while also truly learning what it is that we’re incorporating into our codebase.
In previous posts, I’ve talked about the idea of focusing on an area and going deep rather than wide. This is personal preference, of course, but it’s mine, nonetheless.
Over the last year, though, one of the byproducts that I’ve found is the longer you stay in a given industry, the more common certain problems become. (This shouldn’t come as a surprise as this is precisely why we have design patterns.)
But the thing about doing this is that you develop a sort of tunnel vision for ways to solve problems.
Case in point: Recently, I was tasked with needing to develop some functionality that was going to parse markup and convert it into a slightly different format.
The content of this post is essentially the text version of the talk that I recently gave at WordCamp Atlanta 2019. Sure, some parts are left out, and some parts are modified but I do that since this is a different medium and certain statements or examples don’t translate as well. 🙃
The purpose of the talk, as you can tell from the title, is presenting a case for building web applications with WordPress.
I believe it can be done – because I’ve seen it done and worked with teams who do it – but before actually looking into the reasons why I think it’s a good foundation for certain applications, I also want to clarify terminology that we toss around a bit.
Ultimately, I want to define my terms so there isn’t any confusion, and then I want to use said terms to move forward.
But enough of the setup, right? Here’s the content of the talk.