C++: The Teaching Language
I just had a talk with Ryan about teaching people to program, and I was finally able to pin down one of my big opinions on the subject. After months of trying to put a finger on it, I was able to realize just why it is that I like C++ as a teaching language over C# (which I prefer to program in).
What it comes down to is that C++, in my opinion, is an easier language for the teacher to work with. Because it is easy to write programs in C++ that make no use of pointers, OOP, or windowed interfaces, C++ allows a teacher to begin teaching without having to worry about having to go too in depth on a topic every time Òwhy do _____.Ó Ultimately, every other reason I’ve ever given for not liking C# (or Java for that matter) comes down to the ÒWhys.Ó
Take a look at Hello World in C++ and then C#:
#include <iostream.h>
main()
{
cout << \"Hello World!\";
return 0;
}
And now for C#:
using System;
public class Hello2
{
public static void Main()
{
Console.WriteLine(\"Hello, World!\");
}
}
On first look they look pretty even. Pretty simple. But when you actually start going through the code, C# forces you to explain classes (on some level). There is also having to worry about public/private and static/instanced. Now while you may not plan to cover those topics right away, people tend to start asking ÒWhy do I need to include that?Ó Once they do, it’s very hard not to start spiraling.
In both cases there is hand waiving and the yelling of Òignore the man behind the curtain,Ó but at least with C++ it’s a bit easier to push stuff off to a later date. And this doesn’t stop. It just builds. As you move on into variables, functions, and loops the nuances of C# press more and more extraneous issues, where as C++ can remain pretty on course.
Mind you, once you get past the basics and start getting into pointers and such, I will admit that C# is probably easier. Since it’s much harder to get oneself into trouble than in C++. At the same time, you don’t really know what’s going on with the memory at the level of C# so it’s definitely a trade off, but I will go into that later.

