The Metaphysical Mental Models: Abstraction & The Feedback Loop
Recently, I've been thinking about those early days of when I first started out coding.
There were a bajillion things to learn, right?
And today, we have new tools, libraries, frameworks… and AI tech.
I remember that feeling. Like I was on a never-ending treadmill, always learning new stuff, but still writing spaghetti messes and untestable code in my codebases.
Eventually I had enough of that and went on a journey to discover how to master what matters.
Today, after all that time and what I've seen, I realize something key – simplicity is golden.
And that goes for most things in life actually.
But if I were to write a letter to myself when I was first starting out, I’d tell him this:
“Khalil. Keep it simple. Your entire job as a programmer is to perform problem decomposition. Break valuable problems down into bite-sized pieces and find solutions with code."
I’d also tell him that:
“Programming and problem decomposition are mostly about mental models. Your code is only as good as if it solves a problem or not, and if it uses language and symbols that other developers understand. To help you, there are 2 main mental models you need to master: Abstraction and The Feedback Loop. Keep learning new tools and improving your stack, yes, but primarily focus on how to use these concepts while coding. Everything will come into place if you do.”
Allow me to explain what they are.
Abstraction
How aware are you of what’s going on behind the scenes when you press “POWER” on your tv remote? Do you know how the sequences of 0’s and 1’s sent from the remote to the receiver are encoded, transmitted & decoded?
Or is it simply enough to think “power button means the tv turns on”?
Second answer, right? Yeah, second answer.
Abstraction is one of the least understood concepts… but also the most important.
It’s all about taking a big, complex problem, breaking it apart and creating new, easier to understand chunks or layers of the problem that interact with each other to solve the problem.
Do it right and our codebases are valuable, readable, understandable — glorious.
Do it incorrectly and our code starts to look like the inside of a turtle (I have no idea what that might look like, nor do I want to, but I imagine it’s not pleasant).
The Feedback Loop
I used to spend so much time changing lines of React code, refreshing the UI, re-walking through a set of steps to see if it worked and - nope, didn't work, time to try again.
These days I just write a test, the minimum amount of code I have to, and avoid all of that.
If I could get those hours back.
I'd probably have had so many more hours to go pro Junkrat in my Overwatch career back then.
There are so many more effective ways to work. In the course, we talk about something called The Ideal Developer Workflow and FA²STR but really, simplicity-wise - it comes down to introducing Feedback Loops.
For example, when we learn how to talk to customers, use things like Impact Maps, DDD techniques like Event Storming & Modelling to clarify before we build, and when we work outside-in by driving your code with tests first (yes, tests, y'all - I know... trust me though, they're not as scary as they seem)… well, then we’re using feedback loops conceptually.
How so?
We’re making a guess, taking action based on that guess, and then we check to make sure we’re OK before continuing deeper and deeper into abstraction-land.
Do this right and we build the right thing, the right way, and with useful tests that’ve got our backs (to protect against accidentally changing some code that breaks an existing feature).
So next time you're coding, if you care about long-term quality (you probably do if you're subscribed to this newsletter - you absolute class act), think about abstraction & the feedback loop.
How might you use these ideas better?
Framing your focus this way makes a huge difference.
And hey, nobody gets it perfect from the start.
Actually, I’ve learned that there are about 5 Stages of Phases of Craftship (a coaching tool I use to make sense of a developer's skill level) that we tend to go through as we improve.
This happens naturally if we're exposed to the right paradigm shifts at the right times, where each one involves better use of each of the essential mental models!
But more on that later.
Looking forward to hearing your thoughts on this.
Stay in touch!
Join 20000+ value-creating Software Essentialists getting actionable advice on how to master what matters each week. 🖖
View more in The Metaphysics