To C(++) or not to C(++)

The primary text books for my sons was (and still is) Starting out with C++. From Control Structures through Objects by Tony Gaddis published by Addison Wesley 2009. We use the 6th edition which is not as expensive as the most recent ones.

 
I feel that this is one of the best introductory and intermediate textbook around. My decision to jump right into C++ is based on decades of my experience in teaching programming and my professional software development career. I decided against starting with an “easier” language like Python or PhP. I also decided against starting with Java.
There are two reasons. I think that C++ used from the very beginning imposes the structure and algorithmic thinking on the student, whereas other languages offer much abbreviated notation that might not be transferrable to other programming languages.
Secondly, one of the biggest problems in programming is managed code vs. unmanaged code. Basically, we can write code and let the programming environment manage memory (managed code) or do it manually. Programmers, who manage manually the memory, have a bit more complexity to deal with. However, the benefits are enormous. Besides, a much better understanding of what is going on, the code runs more efficiently. Managed programming languages like Java or C# execute much slower. One of the key reasons is that managed environment is less efficient.
 
Another big discussion among programmers and researchers centers on single-threaded vs. multi-threaded programming. Basically, all computers today are equipped with multi-core CPUs (central processing units). It means that, by design, microprocessors are designed to execute multiple programs in parallel. Many programmers support the approach of teaching parallel programming for multi-core CPUs from the introductory courses. Environments supporting parallel programming like OpenMP or MPI have almost a religious following.
 
 
 
 
  Despite the obvious importance of parallel code architectures we have decided to skip this topic until my sons have a good grasp of basic data processing algorithms and data structures. Computer graphics is also a big magnet for the boys. Therefore, we devoted a significant amount of time to studying the contents of the following text: The Nature of Code: Simulating Natural Systems with Processing by Daniel Shiffman.
 
 
 
It is a wonderful resource for learning computer graphics and visualizations applicable to such fields as multi-agent system simulations, physical system simulations, steering behaviors, etc. The code discussed in the book is based on Java and Processing.org framework.
 

 
Although I mentioned several times that we decided to focus on C++, this Java-based framework offers one major advantage i.e. the graphical libraries are integrated in the framework. Therefore, displaying graphics on screen is significantly easier compering to C++ and OpenGL or DirectX. (I will write a separate post on OpenGL programming). The ease of use is important for a beginner or intermediate programmer. Often, displaying the simplest shape on screen requires a significant setup and a good understanding of video card hardware.

Future work in computer graphics
 Computer graphics is a very mathematical field. Down the road, I will introduce a more general textbook into our curriculum. The Computational Geometry in C by Joseph O’Rourke is discussing basic concepts lie Voronoi diagrams or intersecting polygons with code examples. This book will be a great foundation for future studies in advanced 3D graphics.
 
 
 

Programming curriculum: a journey that started when my kids were about 8 year old

My kids watched me spending long hours writing code at home. This probably made them think that software development is a “regular” kind of a job i.e. there is no barriers of entry. My boys just wanted to emulate their father.

We started learning programming at the age of 8. At this age they became reasonably comfortable with the keyboard and spelling of basic English keywords like: for, while, writeln, etc.



I told my kids that programming is a very important aspect of the curriculum. They probably did not understand what I meant. However, when I started talking about video game programming – they got my message. Suddenly object oriented programming and 3D modeling became exciting topics. My sons started asking me about good text books for learning programming.

I decided to skip the traditional procedural introductory material. We jumped right into object oriented style of programming using C++. I decided against spending time on typical beginner tools like Alice or Logo. I have to admit that I was a little surprised how easily they understood the concepts like classes, objects, inheritance or polymorphism.

After several years of learning programming my kids are able to dive into quite complex programming environments. One of my boys became very interested in Minecraft programming using Java and Forge. This is a very challenging combination of tools and libraries. My other son is more interested in 3D graphics and uses Blender to develop his animations and small interactive simulations and games.

I this blog I will be posting materials that we use in our curriculum. I will also discuss effectiveness of various approaches to teaching programming.

Mathematics - the ill-defined problem

Teaching mathematics – the ill-defined problem

 
Let me start with a few questions that probably most parents and students are thinking about:
 
Is mathematics hard?
Does it require special skills?
Are there kids that will never be comfortable with mathematical reasoning?
Do all kids need intermediate and advanced math curricula?
What is the best way to teach math?
 
 
First, let me be honest about my background.
I love math. I took math courses at all levels, including post-graduate research. My masters and PhD dissertations were about mathematics. I’m a member of the Mathematical Association of America (MAA).
Second, let me be honest about my training.
My math courses were very traditional and tough. Homework was very time consuming.
Can mathematics be taught in a very entertaining and efficient way? Probably, yes. Khan Academy is one of the best examples I know. Computer science is a great vehicle for teaching math. Computer graphics is one of the most exciting applications of advanced matrix algebra, calculus and trigonometry. Most programming text books are very heavily invested in mathematical algorithms.
 
 
 
In my opinion, learning math beyond basics is a process that requires a lot of dedication. It is similar to learning how to play musical instruments. It takes years of dedicated work. I’m not aware of any shortcut methods.
The good news is that, in time, it gets easier. My kids spend a lot of time working on their math exercises (and musical instruments). Initially, our progress was slow. After a couple of year, they started to rapidly improve. Currently, they are able to do a lot of work independently. Their progress is very impressive. They have learned how to use mathematical software to help them with graphing functions and checking the correctness of solutions. I think that they enjoy math, which could be the greatest success in this journey. My son recently decided that he will be posting YouTube vides on calculus problems.
 
 
 
After completing an intermediate algebra book we started working on calculus about 6 months ago. Our approach is simple. We discuss each topic and solve all example problems and end-of-chapter exercises.
 
 
 
Obviously, college level text books are not perfect for a 12 year old kid. Particularly, some of the textual problems require a lot of background in science and English comprehension.
In general, the progress shown by my boys is quite impressive. Devoting a couple of hours on solving mathematical exercises is extremely beneficial. This approach leads to, a slow, but measurable problem solving skill development. I’m not sure if non-traditional, edutainment based techniques would allow problem solving development at this rate.
Let me use the music analogy again. Years of dedicated practice, often mundane and tedious exercises, develops young musicians into mature artist capable of understanding and performing great classical symphonies. Improving original music can also be achieved after devoting significant about of time into practice.
Is there any other way to achieve our educational goals …?

Finally, how do we asses the learning outcomes? I’m aware about significant research in this field. What counts for me is a couple of things.

Enjoyment. This was my big hope. I keep telling my kids to start loving and enjoying math. Once you develop your skills, you will start enjoying the logic, problem solving, your ability to understand new concepts, etc. It appears that our very traditional approach to learning worked. Now, my kids come to me almost every day showing how quickly they understood another chapter.
 
Problem solving skills development. At this age (12 and 10), we are not tailoring our studies towards any particular standardized tests. What counts is to be able to solve problems. We focus on solving all exercise problems from each topic or chapter. Often, we find additional problems online. Reviewing theory is, in my opinion, only about 20% of the job. 80% of time is devoted to solving exercises.