Teaching Coding vs. Learning Coding
The way I learned to program is basically the opposite of how we teach people programming. The way programming is taught is typically aligned to how computers work, and how a language works - e.g., language constructs and syntax. Something like this:
- Chapter 1: Data Types
- Chapter 2: Variables
- Chapter 3: Operators/Math
- Chapter 4: Control structures
- Chapter 5: Arrays
- Chapter 6: Functions
- Chapter 7: Structs
- Chapter 8: Classes and Objects
- Chapter 9: Methods
- Chapter 10: Inheritance and Polymorphism
- Chapter 11: Some advanced thing X
- Chapter 12: Some esoteric thing Y
- Chapter 13: You think you are so smart - let's introduce concurrency!
The way I learned programming is by building things!
It starts with a desire to make something - to create. It begins with a desire to create a website, or an API, or a program that reads tweets and calculates sentiment. To create something, I need skills! The motivation to learn the skills springs from the desire to create.
I believe artists learn to paint or sculpt to create something, to express themselves. They want to share something with the world and need a way to bring it to life. I believe the same principle applies to programming.
“The limits of my language mean the limits of my world.”– Ludwig Wittgenstein, Tractatus logigo-philosphicus
If I don’t already know the language, I will setup a development environment, get the reference material (e.g., “The Go programming Language” by Donovan and Kernigan) and begin. I will read enough to get myself started, I will seek examples of good code on GitHub, I will watch YouTube videos, and if I get stuck, I go back to the reference material. Rarely, if ever, will I read a code language book cover to cover – I tend to use it as reference material only.
We know intuitively and backed up by research that humans learn:
- When we are motivated and want to learn
- We learn by doing.
Go out there and build something! Better yet, do it with a group of people who are learning the same thing. Peer instruction and live coding are amazing ways to learn programming but also all the other things like how to set up your development tools, what programming fonts look best, how to use Git, etc. This is one of the main reasons I love forms of “group” programming – for example pair or mob programming.
What are you creating? What are you learning in the process?
- How to Teach Programming
- Ten quick tips for teaching programming
- How Do We Best Teach Programming to Beginners?
Image Credit: Ken Thompson and Dennis Ritchie
Dennis Ritchie is sitting at the console at Bell Labs in 1972. Dennis created the C programming language and, with colleague Ken Thompson (who is looking over his shoulder), the Unix operating system. Ritchie and Thompson were awarded the Turing Award from the ACM in 1983, the Hamming Medal from the IEEE in 1990 and the National Medal of Technology from President Bill Clinton in 1999. Dennis Ritchie and Brian Kernigan wrote the book "The C Programming Language", also known as "K&R" - my first programming language book!