I present my pedagogical concept: Kids need to learn two programming languages: one easy and one “correct”.
Why two languages?
Once I wrote in a Web forum: Why Russian schools still teach Pascal, not something more modern such as Python? Another person pulled me up: “Python?! You want children to study crap-code?”
I realized that he was right: These people who know only Python do not really understand how computers work. They may think that every programming language is like Python: we can pass as the same argument to a function either integer or string, then function decides what to do with it dependently on its type. It is acceptable if we have just one function and two types. When we have 10 functions and 10 types, following this pattern (programmers call such pattern anti-patterns) becomes a headache to understand and debug code.
Another language taught in schools is Java. Java is solid, Java is done “correctly”. But Java does not have enough features. It could be foreseen (and now is a life fact) since advent of Python that Python will become more popular than Java. Teaching children Java does not give them solid foundation of modern programming.
Another popular choice is… C++. Don’t make me laugh: C++ as the first language for a middle school person, that’s hilarious. While best students can learn C++ as their first programming language, the rests’ brains would be just overloaded by it. Almost nobody knows C++ completely. (I, as a rare exception, read the entire C++ standard; and it has very many pitfalls, as if it were designed not for humans but for computers. What about the rule that each class that is inherited must have a virtual or protected destructor? Who follows this rule avoiding unexpected “unexplanable” program crashes?) You need to teach children, not to torture them.
So, what to choose for your child: a simple but defective language (Python or Java) or an overly complex C++? I suppose that by laws of mathematics, it’s impossible to make a language that is both simple as Python or Java and present all needed features. So, teach children two languages: first Python or Java, then D programming language.
Here are short overview and advantages of D.
D has all useful features of C++ (and much more), but isn’t as complex and tricky as C++. And while D is apparently somehow harder to learn than Python, learning D is manageable (unlike learning C++ being unmanageable for most people).
D is a perfect replacement of C++, Python, and Java. It is just better than any of those. D seems being near to an ideal “perfect programming language” from not yet discovered mathematical classification of perfect languages.
I propose to teach students this way:
- Teach them Python, by the way demonstrating bad programming examples and saying that in the next class they will learn how to do it the right way.
- Teach them D, for each noted bad Python code showing them the proper way to do it in D.
D is the only programming language that has a good feature corresponding to every bad Python pattern. With no other language you can do this trick.
Purchase D Language Course (the D programming language PDF files + exams + thesis).
As the result you learn (or teach) the best hybrid programming language, more specifically the best back-end programming language (well, some say Rust is the best; but some say that Rust is a language for geniuses and that refactoring Rust software is unmanageable). See the course page on comparison of D to other languages.