Teaching how to code is broken

Typically:

This is fine for a reference book for an experienced professional. It is a terrible format for tutorials or any guidance material that intends to teach people how to code, specifically beginners.

Why? Because none of these chapters answer the most important question a reader has, the entire time, WHY!? Why is all this important and what problems does it solve? When should I use this thing that I learned? Imagine if aliens landed on earth and we teach them everything about the shape of a fork, its material, how its made, typical ways of holding it, various shapes of forks, its history, and etymology, but never tell them that a fork is used to pick up food and stick it in the mouth.

Teaching how to code should be about problem-solving and effectively using the tools of a programming language to solve it. Say for example modeling a card game. Even better if the example is a continuous improvement starting from the very basics, hard coding stuff, and then increasing the scope as follows:

There are very few resources out there that truly embrace this type of teaching – e.g. the absolutely brilliant Nature of Code for beginners. Another one for experienced software engineers is Architecture Patterns with Python (models an e-commerce business from scratch).

I've found that modeling or simulating something real like a card game is very effective. It teaches students about how to translate a real-world situation/problem/thing/phenomenon into code. Teaches them about assumptions and limitations of the model they've built. Also, it teaches them about how to interrogate requirements imposed by the real world through simplification/abstraction or simply rejecting some aspects of it as "Too complex, costly and impractical to model with no real benefit or a clear use case" :-).


Image credit: https://commons.wikimedia.org/wiki/File:Croneberg_and_Stokoe.png Deafhistory101, CC BY-SA 4.0 https://creativecommons.org/licenses/by-sa/4.0, via Wikimedia Commons

← Back to Home


Self promotion. Check out our new typeface, Berkeley Mono:

Berkeley Mono →