Picking Programming Languages for High School – Never Ending Story

I see that Susan Canaga is bringing her school's discussion on programming languages looking for industry opinions. This is a topic I have addressed a number of times before (most recently here) but one which never seems to be settled. In any case if you an opinionated individual and want to put in your two cents I'm sure Susan would welcome the feedback.

As I have said more than a few times I like Visual Basic. NET as a first language. The syntax is easier than the C based languages. Literally millions of programmers use Visual Basic to develop applications with significant user interface needs. So it does scale up to full scale professional development.

C# would be my second choice for a first language and my first choice for a second one. I like that it is a .NET language which means that you can learn and use the .NET Framework classes. And of course C# allows students and others to easily use the XNA Game Studio Express to create video games for both Windows and the Xbox 360. I happen to think that C# is an easier language to learn than Java. Yes I am biased but I came to that conclusion years before I came to work for Microsoft. I like the way built-in types are handled in C#. I also like using properties (an option in VB as well of course) and other features. LINQ and related features that are coming (also for VB) in the near future look like they have the potentially to really simplify handling data bases and other large amounts of data easily. That has huge potential.

C++ is a language that is not going to go away any time soon. It is still the language of choice for a lot of high performance gaming, embedded systems, and anything that absolutely has to get close to the hardware. A first language? Not if up to me. On the other hand the things one can teach using C++ makes it an important language for someone who intends to be a serious student of computer science. If it were up to me I would probably have left C++ as the language of the Advanced Placement exam. C++ is not the best way to learn object oriented programming. C#, VB and even Java are better for that. On the other hand there is power, at the cost of ease and safety of course, in C++. I like that for when it is really needed.

But of course if it were up to me no one would take AP CS as their first programming course. That's like taking AP Calculus without having Algebra and Geometry first. It can be done but it is hardly a good idea.

The Visual Studio Express editions are available for free in C++, C#, Visual Basic and Visual Web Developer editions so teachers and students have some great free options for all of those languages. If someone wants to make the case that Java is better than either C# or VB as a first language go ahead. (I've got my flack jacket on.) I feel sorry for AP teachers who have no choice but to teach it.


Technorati tags: , , ,

Comments (21)

  1. Luciano says:

    When you start to learn your first language (italian in my case), you start from the building blocks (the letter).

    When studing math you start from the numbers, the basic operation, and so on.

    Why should you start to learn programming from object?

    My suggestions is: ASSEMBLY 🙂

  2. Adam says:


    I’d tend to stick away from languages that enforce a rigid programming style. Unfortunately, this rules out pretty much everything .NET related, with it’s "*everything* must be part of a ‘class’" mentality.

    Static functions are not object-oriented. That’s OK, there’s nothing wrong with non-OO functions – C and all its descendents had been doing fine without them for years. Classes without per-instance member data are also not OO; static classes are just syntactic salt for namespaces.

    "public static void main()"?? Please!

    For a first language, I’d go with a simple imperative language; the kind you could just write an equivalent of:

    10 print "hello"

    20 goto 10

    in, in no more than 5 lines total, and have an environment where you can just "run" it, without even needing to hear about "compilation".

    I’d probably go with Python.

    (Disclaimer, I’m a C/C++ programmer, but other experience includes a couple of years of C#/VB.NET, a year of VB6, some UNIX shell scripting, some Delphi in ’98/’99 (can’t remember which version), a year or two of VB3, batch file programming (ugh!), GWBasic, BBC Basic and a tiny amount of 6502 assembler. I keep not getting around to learning Python properly, but every time I look at it and hear more technical stuff about it, I become more impressed with it. I also have to learn lisp at some point. *sigh* So much to do, so little time…. 🙂

  3. John C says:

    Sinclair Basic running on a 48K Spectrum (there are some good emulators out there) 😉

    But seriously, forget startin with an OO language and start with a nice, simple, functional language. Get the basics down first, like loop constructs, conditions, logical expressions and the like. Then move on to OO design and programming.

    There are a number of young programmers out there who can come up with good OO implementations at a high level, but whose basic understanding of logic is sadly lacking.

    How did I learn? Spectrum Basic at age 6, Z80 assembler at 8, C at 10, 6800 assembler at 16, 6502 (with out an assembler) at 18. Then I went to university and learned to program ‘for real’ in COBOL, ADA and eventually C++. In the real world I’ve been a C++ and VB man for about 12 years now.

  4. tzagotta says:

    I would advocate C# instead of VB as the first language.  In my opinion, once you learn C#, you can more easily "step down" to VB, rather than if you learn VB first, it is a bit harder to "step up" to C#.  I have seen this with several professional programmers in my career who are unable to "escape" VB and pick up other languages.  This is especially the case if your resume indicates a large amount of VB experience; prospective employers tend to assume that you can’t handle languages in the C/C++/C#/Java group.  It is also my experience that programmers in the latter group are generally paid more than VB programmers.

    I also disagree that Java presents a larger learning curve compared to C#.  I recently learned both Java and C# after having programmed in C++ for many years.  While I prefer C# over Java due to its more refined syntax, I don’t see any difference in the learning curves for the two – the language, the IDEs, or the supporting frameworks are really about the same.

    Finally, I’m not in agreement about your correlation between C++ and safety.  In my experience, without any further guidance, programs written in C# will be "safer" than C++, i.e., less prone to subtle bugs due to inherent problems in the language, length of learning curve to “mastery,” etc.  If you were to develop safety programming requirements for C#, as has been done in the past with C/C++ (e.g., MISRA), I think you’ll end up with fewer "additional" requirements/restrictions and a better overall result in terms of safety.  But maybe I am misunderstanding what you meant by "safety."

  5. AlfredTh says:

    Some how learning Assembly before learning higher level languages seems like learing how to ride a unicycle before learning how to ride a bicycle. There is no question that knowing how to ride a unicycle helps to become a better bicycle rider (I do ride a unicycle) but I don’t think it should be a required first step.

  6. tzagotta says:

    I agree – there is no need to teach assembly before high-level languages.  In fact, for most (probably 99%) of students today, there is no practical reason to learn assembly at all.  Looking at today’s job market, assembly is a skill that is needed less and less, and I don’t see anything that will change that trend.  In the future, it will be a niche skill only required by a very small percentage of developers.

    Looking at it another way, there is no need to "layer" learning so that you learn lower levels of abstractions first before learning higher levels.  If anything, the opposite is probably true – we should probably teach higher levels of abstraction first, and then for the subset of folks who are interested or otherwise motivated to learn, they can learn the lower levels of abstraction after that.

  7. BBaker says:

    I start my first years out with Turbo C++ 3.0. The compiler is old but it’s a great teaching environment. This is my 7th year going this route and it has proven to be very successful as my 2nd year students find the move to objects (OOP) fairly painless. We start out with console applications using classes in Java and repeat 1st year in around 6 to 8 weeks. Then we move to C#.net, the first couple of programs are still console apps just so they get the feel for the new environment. From there we spend another 4 to 6 weeks working on classes and objects in C#.net. The students seem to have little trouble making the move from a function based first language to an Object language. My 3rd years can move on to C++.net or spend move time mastering DirectX and networking in C#.net.

    As far as safety goes for the 1st years, AP strings and arrays do a great job of teaching the students about limits/problems, say going outside the range of an array without crashing. And even when they do crash the API, it just goes to the desktop and they just start it back up. That does help reinforce the “Save and Save often” mantra I use.

  8. Every time this topic comes up, we end up swapping brand names, which is fair enough when it is a matter for making a list for people to choose from, but it is NOT computer science, it is the habit of common computer scientists you are talking about. So the questions when posed are a question of choice at levels. VB versus C++/C#/Java/Python is a matter of tea versus coffee (Java, C++, C#, Python are descendants of a compromise algorihtmic description system between the representatives of ACM and GAMM in the creation of the three Algols; Basic was essentially an attempt to get the expressivity of Fortran to be interactive, with an addition of features found in JOSS and Algol60 developed by two visionaries at Dartmouth).

    Python versus Java is more like Coke versus Coffee. Java versus C# is like Coke versus Pepsi.

    Dijsktra himself said computer science is about computers like astronomy is about telescopes.

    So the question really is – do you want a programming language that best prepares children to learn how to work with computers (choose a language sold by a big company that will assure work: Java, VB, C#) or a language that expresses current ideas about programming design (C# or Python or Fortran 2003).

    Then there is the question of the IDE – the more handholding and help the better. Intellisense in Visual Studio is hard to beat.

    Then there are those that are designed to teach computing science in a clear manner: Scheme, Squeak, Haskell. But they hold you back at getting work.

    There are incredibly powerful systems like the APL languages that enable powerful and laconic expression of thought without destructive reductional thought, but are hard for many people to read/understand.

    Utility languages like SQL, PERL, PHP, Javascript are incredible powerful in their domain, but fall away from that position of power when building up to applications.

    Then there are systems designed to express complicated logical problems easily – Prolog, Simscsript, Snobol: these are hard to bend to workaday programming.

    None of these are /good/ programming languages though. But if you want to teach kids how to write algorithmic programs in a way that avoids bad habits, Python is the least worst as it was designed to this precisely, it is the Dartmouth Basic of our time, and Van Rossum put a lot of thought into it to achieve that goal.

    But I question (like many others) where teaching people reductive thought leaves experimental computer science. There are no "pen and pencil and paper" equivalents for computer science. Everything buys into a particular genre of the computing zeitgeist – brandnaming, faddism, traditional approaches, ease of establishment.

    Disclaimer: I am a historian of programming languages and have examined well over 10,000 of them in the last 14 years. I have read too many empty statements by manufacturers and programming pundits that say the same thing about different systems. And rather sadly, many things that were once possible to achieve in computing are no longer because of the prevailing reductive/algorithmic paradigm.

    (Posting this here as well as on that blog as it might not be posted there)

  9. Gregg Irwin says:

    The problem I have with any .NET language, including VB, being a first language, is the same problem I have with many of the new Lego sets; they contain all these specific pieces, designed for building *that one set*, rather than a bunch of very abstract square blocks.

    Those specialized pieces allow you to envision new things you wouldn’t be able to had you only seen square blocks, but they also *limit* your thinking (IMO). I’m a big believer in the power of constraints, but not this kind of constraint, when what you want to learn is how to think about, look at, and solve problems in different ways.

  10. AlfredTh says:

    That would be the same for any language with a rich library including Java and C++. What languages would you see as less constrained?

  11. Tom says:

    Gregg, that’s an interesting point about the Legos.  My kids are just getting to the age, and that’s one aspect today’s Legos that I don’t like ("this set builds this specific toy") compared to those that I had when I was a kid ("all square blocks that could, with some imagination, be built into anything").

    But I don’t understand the analogy to .NET.  I don’t see how .NET, or its supported languages, take you down the path to creating specific types of programs.  I kind of feel that, whatever I want to develop at a given moment, I’m confident that I can do it in C# without any real problems.  For example, today I might build a rich GUI, tomorrow a web site, the next day a web service or a command-line app.  Also, I don’t see how it limits your approach in non-useful ways.

    Can you elaborate more about what you mean?

  12. Gregg Irwin says:

    I’ll try to elaborate, and apologize in advance if you need to ask me to try again. 🙂

    "That would be the same for any language with a rich library…"

    Yes, the question is "what can you do in the language *without* those libraries? How do you do something in C# without using .NET? How do you explore different ways of solving problems when that’s not how they teach you to use the language; what they do is teach you how to find existing solutions in the framework.

    I’m not saying that .NET languages are bad, just that they’re designed for practitioners, not learning how to solve problems. I think Python would suffer the same way, because there is the "one right way" mentality about it.

    As far as constraints, it’s hard to say. The Logo turtle was *very* constrained, but it was designed to be that way for just this purpose. So, one way to look at it would be to say we need a lot of little languages that are designed to help us learn to solve problems in different domains; or you could say we need a very unconstrained language (Lisp, Forth, REBOL) that let’s us to pretty much anything, and think about problems any way we want.

  13. AlfredTh says:

    Gregg, I think I understand what you are saying but at the same time I think the problem is not so much with the .NET Framework or with other sets of libraries but with the teacher. There is little doubt in my mind that those who teach themselves will tend to fall into the trap you speak of. At the same time I think that beginners (people who have never programmed at all) are much better off with a teacher to guide them. That teacher can, if at all skillfull, work around those constraints. I think that self taught programmers are much more limited in outlook and understanding that well taught students of good teachers. Yes finding those good teachers is a challenge but I think that a good teacher can do a lot more than sending a self-learner to a specific language.

  14. Gregg Irwin says:

    I guess it also depends on how you expect the language to be taught. In the case of .NET languages, would you emphasize finding solutions in the framework, or using the raw language and developing solutions from the ground up?

    In the case of Java and C#, I think there is also a *lot* of syntax that gets in the way of understanding and thinking about the problem itself.

  15. Gregg Irwin says:

    "I think that self taught programmers are much more limited in outlook and understanding that well taught students of good teachers."

    Being self-taught, and knowing a number of others like myself who, IMO, are not limited in those ways, I’ll take issue with that statement. What do you base it on?

    You know, the only *real* education is self-education. 😉

  16. AlfredTh says:

    I’ve been working with programmers for over 30 years and I’ve seen a lot and all kinds of programmers. I think that if you compare self-taught with teacher taught programmers in their first few years you will find that the self-taught programmers generally learned a narrower set of tools. After a while the programmers with good minds keep learning and expand their horizons so after 5 to 10 years there is less variation among good programmers. Among average programmers I think the variation is still there but the teacher taught programmers seem to grow to be very good programmers in greater numbers.

    To be fair, I have met some great self-taught programmers. Generally they worked very hard at it, reading books, talking to others and yes even taking classes. I’m not sure where the line becomes self-taught and professionally trained among experienced programmers.

    There is general and there is specific. I think my statement is generally true but that there are specific cases that are exceptions on both sides of the self/teacher taught coin.

  17. Gregg Irwin says:

    "…self taught programmers are much more limited in outlook and understanding"

    "…if you compare self-taught with teacher taught programmers in their first few years you will find that the self-taught programmers generally learned a narrower set of tools"

    These are two different statements, WRT "understanding" versus "narrower toolset"; I can agreee with the latter, with an addendum that it’s a depth-versus-breadth and theory-versus-pratice difference. e.g., in my early years I didn’t learn anything about compiler theory, but I got a lot of what they call "experience". 🙂

  18. Tom says:

    I would add that the distinction between "self-taught" versus "teacher-taught" is not always clear.  For example, if I read a well-written book that teaches me a programming language or a technique, I may consider that to be self-taught, but clearly the benefits of the experience of the author are brought to my learning experience.  I would guess that most self-taught developers are learning from books and web sites, rather than just sitting down and starting programming and learning on the fly.

  19. Bueno, lo que los gringos llaman el K-12, que más o menos se corresponde a los primeros años

  20. I ran across Robert Floyd’s Turing Award lecture last night. It was an interesting read and frankly there

  21. Bueno, lo que los americanos llaman el K-12, que más o menos se corresponde a los primeros años de secundaria de acá. Alfred Thompson se dedica exclusivamente al tema de qué y cómo se les debe enseñar …

Skip to main content