Learning to program:

Thinking Computer Thoughts

Evan Cole, Director of Elewa Academy
21 January 2018
Javascript is just another language, I’m good at languages. Let’s do this!”   – The Naive Student
Comparing programming to natural language (Creole, Swahili, Hmong,…) makes for fun late-night conversation, but is far from helpful when first learning to program. I’ve witnessed this first hand. Believing that learning programming is like learning another language can lead to frustration when things don’t go smoothly or when previous learning strategies don’t work. It can also lead to building poor mental models of how programs are actually executed by the computer. (These models are called Notional Machines, for you nerds out there). Frustration is naturally bad, but more importantly, unlearning is far harder than learning things right in the first place. In the rest of this post I’ll lay out a way of thinking about programming that can help you understand learning how to code.

What is a language? I’ll stay on the conservative side and say that languages are well-structured messages used to represent ideas.  Once the ideas are stored outside of your head you can share them, develop them, and better remember them. Natural languages have evolved over some huge period of time to serve the every-day needs of humans. They allow us to share and express our experiences of the world, the universal and the specific.

In contrast, computer languages were designed by people to bridge the gap between human thinking and computer execution, sometimes in only a few weeks. They are not designed to communicate the human experience, they are designed to represent and translate algorithms into machine code.  All the most reader-friendly features of programming languages (comments, variable names, objects, functions, …) are the result of programming language designers trying to make life easier for us.  These features are not how computers think – talking directly to a computer without programming languages to translate is a huge pain.  Any poetic exprapolations you’d like to make about well-written code ultimately relies on you understanding the algorithm that code represents.

So how does all of this matter to beginner programmers?  That’s really quite “simple”. It comes down to the Sapir-Whorf Hypothesis (aka linguistic relativity).  according to google:

A hypothesis, first advanced by Edward Sapir in 1929 and subsequently developed by Benjamin Whorf, that the structure of a language determines a native speaker’s perception and categorization of experience.”

All this to say that language and thought form an inescapable causal loop. The thoughts you have influence how you use language – you can only express the thoughts you have (conscious or otherwise). And the language you use influences the thoughts you have – you’re more likely to have thoughts you can express internally or externally.  There are some very interesting examples of this phenomenon (saving for retirement, color terminologyspatial orientation, time conception), and I believe learning to program is one of them.

The proper use of comments is to compensate for our failure to express ourself in code.”  – Bob “Uncle” Martin

So here it is: Programming languages are designed almost exclusively to represent ideas (mental models) related to automation, abstraction, and algorithmics. Natural languages have evolved for the purpose of enabling every-day interactions and expressing the human experience (which usually doesn’t include many algorithms). Learning how to code isn’t about the syntax on the screen, but about learning the thoughts and intuitions that programming languages are intended to represent.
Abstract problem solving is the “purpose” of programming languages, and that’s just not a type of thought everyone is used to having. It can take a lot of work to learn this skill. Much more work than the relatively simple syntax of a programming language would indicate. This is the opposite of learning another human language where you already have the right thoughts (I’m hungry. Give me more bitcoin. The cat sat on a wall.), but need to learn hundreds of words and complex grammar rules, learn to pronounce the words, and use all of this in live conversation.
“Learning to write programs stretches your mind, and helps you think better, creates a way of thinking about things that I think is helpful in all domains.”  – Bill Gates
Whether or not learning to program is neurologically the same as learning a natural language, or if programmers have the cognitive benefits as being multi-lingual, is something I can’t say. (But many people are thinking about this [1, 2, 3]). I can say that once you begin to think of programming languages in the light of mental models (having the right thoughts) and linguistic relativity (thought/lanugage interactions), learning to program becomes a lot less mysterious.
In addition to understanding your own experience learning to code, this perspective can begin to demystify a whole lot of other interesting programming-related questions:
Think on those for a minute.
Programming is abstract problem solving, I’m good at that. Let’s give Javascript a try!” – The Enlighted Student
Share your thoughts
Become part of our open community, and get coding!
Related Articles
Start Learning

Start Learning

Get free access to our open and available curiculum. Be ahead of the future and start learning now!

Thank you! We will send you the curriculum soon!

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list and receive cool updates about our curriculum, approaches to 21st century learning, coding, market orientation, etc. 

You have succesfully described. Prepare to receive the news as it comes in!

Pin It on Pinterest

Share This