- Beginner Focused
- Posts
- Making the Invisible Visible
Making the Invisible Visible
I could make a good argument that the hardest challenge for someone brand-new to computer programming is to read a few lines of code and construct a “mental model” of what will happen when that code runs.
You may already take it for granted, if you’ve been coding for just a few months and are getting the hang of it. But at the very beginning, this is one of the most puzzling things about learning how to code. “Seeing” the code “run” in your mind’s eye, keeping track of variables in play and their ephemeral state that can change from one line to the next, learning how to think in terms a sequence of steps - these are all challenges that one’s brain has to contend with when we’re first learning to program.
What makes the mental model so hard is that we rarely provide ourselves with visual cues to help us “see” the model in our head.
This is why so many developers like “IDEs”, or other sorts of debugging tools that give you a visual of the current state of every variable, or a call stack, or a class diagram.
If you’re working with a plain text editor, these things can just be invisible and can make it really hard to program or debug something. What
What can you do about it?
Make the invisible visible.
In JavaScript, learn about the console and all the ways in which you can emit variables and messages so you can see what’s going on as the interpreter flies by certain milestones in your code.
In C and other languages, use puts. In Python, there’s print.
It’s not a coincidence that these facilities exist in every language. Every programmer needs help visualizing what’s happening. Don’t try to keep it all in your head and just “guess” that the code is working (especially when there’s sufficient evidence to the contrary).
Consider the following: what can you do to make that feeling of “invisibility” go away?
This principle of turning invisibility into visibility doesn’t only apply to code… it can apply to your career path as well. But that’s a whole other issue, so we’ll pick it up from there next time.
We hope you’ve been enjoying Beginner Focused! If you’ve made it this far, we’d certainly appreciate a couple of things from you, if you get the chance!
Please share Beginner Focused with anyone you’d think would be interested in our FREE, beginner-friendly software development articles and advice. You can simply forward this email to them, or use the referral link below.
We love feedback! Let us know what you’d like us to write about, as you embark on this journey as an early-career software developer.