Mental Models for Learning How to Code and Improve as a Developer
I talk quite a bit about what it takes to become a great developer. In order to achieve a level of mastery I’ve discussed a number of criteria and today I want to add a new pre-requisite to the list. Let me begin by asking you a question. If I showed you some code, would you be able to tell me in a few seconds if it’s good or not?
The world of software development is incredibly complex. However I’ve discovered through the years that the best developers have the uncanny ability to instantly judge the quality of someone’s code.
I’ve spoken at length that the concepts of prodigies an savants are a myth. But if this is the case how can expert developers be able to analyze programs so quickly? To answer this question we need to go back to Fake Ancient Greece.
Mental Models for the Kouros
I said Fake Ancient Greece because my favorite illustration of mental models was discovered alongside one of the greatest forgeries in modern art history. In Malcolm Gladwell’s book Blink, he tells the story of the Greek Kouros. In 1985 the Getty Museum purchased a Greek statue called the Kouros, for over $9 million dollars.
Initially the museum was hesitant to purchase the statue because there was a significant fear that sculpture was a fake. Kouros pieces were so incredibly rare, the chances that a legitimate and well cared for piece had been discovered were slim to none. However the museum was willing to take the risk and embarked on a fact finding mission. They put the statue through every scientific test available at the time. And the Kouros passed with flying colors. After going through the full examination the museum purchased the Kouros for $9 million dollars.
Art historians from all over the world were flown in for the unveiling of the Kouros. But something went terribly wrong. The moment that these specialists saw the statue they knew the Kouros was a fake. Interestingly enough they couldn’t give any actual reason. They simply knew that something was not quite right.
Their suspicions turned out to be correct and the Kouros ended up being proved to be a hoax. But how were these individuals able to do what countless scientific studies could not? It all comes down to mental models.
What are Mental Models?
In preparation for this guide I was discussing the topic of mental models with a friend and was surprised when she looked at me confused. After informing me that she’d never heard of mental models I decided to add in this section to explain what mental models are. And after that we’ll get into how we can build them to learn development.
A mental model is a mental representation of a specific topic or skill. You can’t create a mental model overnight or with ‘cram’ sessions. Mental models are developed through years of repetition and countless hours of honing a craft.
My Dad is a major league hitting coach for the Houston Astros. Throughout my life I’ve been able to watch him instruct hitters on how they can improve their swings. And I’ll never stop being amazed by the fact that he can watch a new hitter’s swing and within a split second pick out multiple ways that the player can improve. I can tell you that he did not develop this skill in a short period of time. He has spent more time watching hitters and film than anyone I know. And through the years he has developed a mental model of what the perfect swing looks like.
Mental Models for Developers
Ok, so we’ve talked about art historians and baseball coaches, but how can we create mental models as developers? You may or may not like the answer, however it doesn’t really matter because it’s the truth. Mental models are made through repetition. However repetition by itself isn’t enough. For example if you built an identical program everyday for 10 years you would get really really good at building that one application. However you wouldn’t improve as a developer.
I’ve talked before how medical research shows that doctors who have spent years practicing on the same types of patients are less proficient than doctors fresh out of residency. In the same way, as developers we improve when we’re stretching ourselves each day.
You can stretch yourself by doing things such as:
- Learning a new programming language or framework.
- Teaching others how to learn programming.
- Creating an open source code library and allowing other developers to use it.
Einstein said it best when he said:
“The only source of knowledge is experience.”
If you dedicate enough time each day improving yourself as a developer you will be able to truthfully answer ‘yes’ to the question I posed at the start of this guide. You will be able to have the ability to look at a piece of code and instantly know if it’s good or bad. And you’ll know that it’s not some type of coding super power, instead it’s a skill that you earned through your constant pursuit of improving as a developer.