What computer language should we teach?

Young people occasionally ask me whether language X is something they’ll need to make computer games, or what they should learn if they want to become programmers. And what language should we teach in school?

I learned UCSD Pascal in school. When I came to university, freshmen were taught C++, and by the time I was in a teaching position myself, the language of choice at almost all universities had changed to Java, so that’s what I taught.

Last year opened my eyes a bit, though. I was interviewing prospective new employees, and several people fresh from school. A lot of candidates were weeded out because they admitted to knowing only Java – and despite numerous claims that this would happen, we still don’t make games in Java, and neither does 97% of the rest of our industry. C++ is the language.

While that was expected, the next group of people we weeded out were the ones that said they knew C++, because they’d taken it for extra credits in school, but still wrote most of their own stuff in Java. Some of them managed to get through to the interview, and failed our C++ test. And that’s where I realized, C++ is so significantly different from Java that it might be a really bad thing for us to teach students Java in school. It’s easier to be a good C++ programmer and then learn Java – beacuse in terms of things you can fuck up, C++ is the bigger problem, but if you master it, Java comes quite easy.

Schools like Java because they can skip over the whole issue of pointers, memory, headers, makefiles, templates and the general nastiness that comes with it. But frankly, if you never hear about memory allocation, pointers and makefiles, it’ll come as a huge surprise to you, which you then treat in one of two ways: you avoid it, and go back to Java, or you try to ignore it, and end uop with really, really bad C++.

Personally, I’d teach people some C first. The pure stuff. I can avoid talking about objects in lesson one (because printf is quicker to explain then std::cout and it’s crazy syntax). Something happens really fast in your program. Memory allocation, headers an Makefiles will appear just like they do in real life. And then, when that’s understood, I’d introduce C++, and when I then explain about templates, containers and classes there will be a collective sigh of relief, just like we sighed it when C++ first appeared. But the students will know that underneath, memory allocation still happens, linked lists are still linked by pointers, templates mean big, big headers, and Makefiles are a bloody pain.

Two things that Java doesn’t do well: Staged delivery of the concepts (instead you get them all at once just for a Hello World) and an understanding of the inner machinations.


2 thoughts on “What computer language should we teach?

  1. Hi Enno,

    interessanter Eintrag.

    Die flächendeckende Vermittlung von Java ist tatsächlich ein Problem: Die Hochschulen sind in dieser Hinsicht der Industrie ausnahmsweise ein paar Jahre voraus. Studenten, die C/C++ beherrschen, gibt es deshalb nicht unbedingt im Überfluss.
    Ein ähnliches Bild ergibt sich bei den Betriebssystemen: Je nach Schwerpunkt beherrschen die Leute nur Windows oder nur Linux. Leute die beides schätzen oder irgendetwas Drittes kennen, gibt es leoder nicht. Sehr schade.

    Ich selbst gehöre ja noch zu C++-Generation, weiss aber auch die Einfachheit und Portabilität von C zu schätzen. Für System-SW wird sich daran auf absehbare Zeit auch nichts ändern, da können noch so viele Studenten Java lernen…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s