Article made by Julia Evans - https://jvns.ca/blog/learn-how-things-work/
To be a good programmer you need to know a lot of things, testing, clean code, design patterns etc.. But often the deep down dive into how things work is overlooked.
Example of how things work
For example in JS, how does the even loop work, what is the same-origin policy and CORS. In system programming the difference between the stack and the heap, how virtual memory works etc..
You can use something without understanding how it works
We work with tons of different systems everyday it is impossible to know how all of thyem work, for example lots of people use email but a few really knows how it works. However when you’re working more seriously on something you’ll start to run into problems if you don’t know the inner-working of that system.
Your bugs will tell you when you need to improve your mental model
When we’re missing a key concept about how something works it cna show up in different ways:
- Bugs in your program appears
- You struggle to fix those bugs quickly
- You’ll feel frustrated An important skill is to recognize that this is happening, being a senior developer is less about knowing everything but recognizing when you don’t know something.
How to go from i’m confused to I get it
On approach is:
- Recognizing you’re confused about a topic, for example an await statement in JS
- Break down the confusion into specific factual questions like when there’s an await and it’s waiting, how does it decide which part of my code runs next? Where is that information stored?
- Find out the answers to those questions by asking or reading on the web.
- Test the understanding by writing out a program. The last step ‘test your understanding’ is very important and often you’ll find that you didn’t grasp the subject yet.
Just learning a few facts can help a lot
Learning how things work doesn’t need to be a big huge thing. For example learning how floating points number works could be big but only knowing roughly how they work, their basics limitation and when to not use them is more often than not is in-half! It will also help you recognize what you don’t know.
Connect new facts to information you already know
When learning a new fact it is easy to recite a sentence about that fact however it is much harder to connect it to something you already know. Explore the connections, be curious about it, usually when connecting the facts the information sticks a lot better!
How to get information
When talking to someone who knows much more than you on a concept it helps to start by asking really simple question where the answer is just yes or no. This is hard to do but it allows you to articulate exactly what your current mental model is.
Yes/no question put you in control
When you ask very open-ended question like how does X work it often goes wrong in one of 2 ways:
- The person starts speaking about a bunch of stuff you already knew
- The person starts speaking about stuff you didn’t knew but which wasn’t really related to what you wanted to understand. Both of these are frustrating but they can’t know what exact information you wanted about X because you didn’t ask them this. With yes/no question you’re way more likely to get the actual information you want.
Asking yes/no questions isn’t always easy
When asking question you may also come across a subject where your mental model is completely wrong it will place you in a more vulnerable position because you’ll have to reveal that you’re actually completely wrong about something.
How to get information: Ask the computer
Sometimes where nobody is around to ask you’ll have to Google something however most people forget that asking a computer is actually a skill, turning ‘i’m confused about X’ into definitive question that can be asked to a computer is hard, Google is not the only source you can also look for information in documentation specialized website etc..
Be aware of what you still don’t understand
The point isn’t to understand every single thing, be aware of what you don’t know, one day you might know how they work but not yet.