Programming for Kids (Part 3): C Programming

C is the third language I decided to teach my son. The plan was simple; follow the theme of getting up to speed quickly, then continue by introducing components of the language with which we would build ‘interesting’ demo programs. In this case, I had already decided to introduce printf, fgets, rand and if – and using those four components we would immediately recreate the number guessing game in C.

The plan seemed to work well, and once he grasped the MVP in C he started experimenting. The results, were even more fantastic than before; he wrote his best game yet!

C is the first language where there is no arbitrary limit to what you can write on modern computers. All modern computers can understand C code, or rather you can compile C code targeting virtually any modern computer system in use today.

Who is this tutorial for?

If you have completed the Shell Scripting tutorial, then you should be okay with this one. It’s just that we aren’t going to explain anything except Makefiles. If you’re comfortable with that, dive right in!

What will you learn?

As stated above, C is the first language without limits, and with power comes responsibility. It is our goal to teach you this responsibility and above all the use of restraint which will come from a deep rooting in analysis, of which the design document and proper commenting will be paramount.

  • You will learn how to write everything you learned in previous lessons in C.
  • You will learn how to write simple, well-organized code.
  • You will learn by example how to write “safe” code (ex. we use fgets for input vs. scanf).
  • And… you will learn to write amazing video games!

To continue reading, please visit the (wiki version) on the Programming for Kids Wiki!