Learn your damn vocabulary!
Yesterday in a conversation with a team-mate we had the idea of a metaphor that turned out to be very useful. Learning programming has a lot in common with learning a foreign language.
We were talking about different experiences while programming. Sometimes you are in a real flow. You can just fluently express all your ideas and create hundreds of lines without stopping. Other times you need to stop every second line to google some details or ask other people.
When using foreign languages you can find situations that feel exactly the same. The tourist with a dictionary needs to lookup every second word. There is no way to start a real conversation. It’s only enough to get to the next train station. But after some years of learning he might join the natives and enjoy a conversation. He can talk fluently and does not look up words or think about the grammar.
If the situations feel so similar, what can we learn from the metaphor. We should look what it takes to become a fluent speaker in a foreign language:
- Learning vocabulary
- Learning grammar
- Using the language
Vocabulary in the world of programming is similar to basic language constructs, keywords and knowing what functionality your libraries are offering. I would also include knowledge about the editor or IDE, keyboard shortcuts and version control.
So what do you need to do to get fluent in your language. Learn your damn vocabulary! You really need to memorize it. It is not enough to be able to look it up. This would be like looking up every second word in a dictionary. A fluent conversation is impossible. Now the good news is, that in a natural language about 1000 words are enough to conduct a fluent conversation. Something similar is probably true for programming. You don’t need to know every detail to be fluent.
But the guy with a vocabulary of 1000 words will probably never win a Pulitzer prize. A lot of people think if they know the basics of their programming environment it is sufficient. No! You have to constantly extend your vocabulary. I am often surprised by discovering new features of the JDK, my IDE or the libraries we are using. Often I realize that I could have saved a lot of time, if only I did know this before. So go and discover new vocabulary and don’t forget to memorize it.
Grammar is more equivalent to higher level constructs like design patterns, data structures or algorithms. When you learn a foreign language, grammar is very helpful in understanding the right way to combine the words. If you don’t know the grammar, the way you use the language usually sounds funny to native speakers. The same goes for the grammar of programming. So learn it if you don’t want to sound funny.
There is another interesting effect. A fluent user of a language usually does not think about grammar. He can often not even explain why he used the words in a certain way. It just felt right. There is a lesson in it. Learn your grammar well but after a while don’t try to think about it to much in order to talk fluently.
Last but not least in order to get fluent in a language you have to use it. You usually start in a class together with a teacher. You have a save environment where you can try your vocabulary and grammar without fear. A good way to do this for programming are code katas. You are in a save environment with peers that support you and give you feedback. You have to repeat a kata often to memorize every important vocabulary.
There are many other well known ways to use programming in order to get fluent:
- Read other peoples code
- Do private projects (and open source them to get feedback)
- And of course your do your daily business
Like learning a foreign language, learning programming takes many years. In the beginning you will be like the tourist and his dictionary. Just make sure that you don’t stay the tourist.
Next time you are stuck every second line while programming try to identify what vocabulary you just did not memorize or what grammar you probably not understood. Then memorize it and repeat …