
Consider this code to find how often words appears in a text:
```
all_words = {}
for word in list_of_words:
if word in all_words:
all_words[word] += 1
else:
all_words[word] = 1
```
Many will react to this with:
> "Ah, but you should use ... instead"
[With `Counter` being the most common response]
But I use this code in my beginners' book and in beginners' courses I teach
Why?
Because I'm not teaching them how to find words in a text.
I'm teaching them how to code,
how to think with a programming mindset,
how to master the basic tools.
This didactic approach happens in all aspects of teaching. Virtually all material children learn at primary school is simplified and "not how I'd do it". A lot of what they learn in secondary school is, too. And there's a reason for that. You need to learn to walk before you can run…
So when you see some code "you'd do differently", think about who's the intended audience. Maybe, that's the right code for them!
English
