My school starts the computer science curriculum with C++ programming courses, meaning this is the first language that many of the students learn.

I've seen that many people dislike C++, and I've read a variety of reasons why. It almost seems to be popular opinion that C++ isn't a very good language. I get the impression it's not very liked based on some questions on StackExchange as well as posts such as:

(Note: It is not my opinion that C++ is a bad language. In fact, it's the main language I use. However, the internet as well as some professors have given me the impression that it's not a very widely liked language. In fact, one of my professor constantly rags on C++, yet it's still the starting language at my college!)

With that in mind, why is this the first language taught at many schools? What are the reasons for starting a programming curriculum with C++?

Note: This question is similar to "Is C++ suitable as a first language", but is a little different since I'm not interested in whether it's suitable, but why it's been chosen.

  • 6
    Which schools & where? All the ones near me (3 in town, and a few others within a couple hours' drive) teach Java as a first language. C++ comes in in the last year or two (depending on which courses a student takes). It's been that way for at least the last 10 years. Commented Jul 25, 2011 at 17:57
  • 7
    Professors are like other programmers in having only moderately rational likes and dislikes. At the same time, they are like students in being experience-deprived. Commented Jul 25, 2011 at 18:00
  • @Casey You'll probably run into some friction with other users here, since you only provided a claim that C++ is disliked but not any justification for it. If your focus is just to find out why C++ is chosen in universities, I strongly suggest you edit out any references it it being liked or disliked since that's largely irrelevant to your actual question.
    – Adam Lear
    Commented Jul 25, 2011 at 18:02
  • 4
    In first year, it's all about separating the wheat from the chaff. Commented Jul 25, 2011 at 18:22
  • 2
    It would be interesting to have some statistics about how many colleges/universities use what languages for their introductory courses. Commented Jul 25, 2011 at 18:48

12 Answers 12


Every single language has a cult following of lovers and haters alike; this is true of C++, Java, C#, Haskell, Objective-C, whatever.

There are many valid reasons to like or dislike a language.

In the end, there are a few reasons why C++ is predominantly taught in universities:

  • It builds on top of C; therefore, the transition from C to C++ is not too painful. Quite a few universities teach C before C++ (which makes a lot of sense IMO).

  • It's one of the most popular languages in the industry (that's starting to change with Java, mobile development, web development, etc. but it's still up there)

  • It's a language that was written by an academic, for academic (ie research) purposes; therefore a lot of professors use it on a day to day basis and are very familiar with it, which makes it an obvious choice for the content of their course.

Don't be too hasty in dismissing it as a "bad" language; I recommend you dive into it, really learn it, build some moderate to large sized projects using it. Then do the same with other languages; at that point you'll have enough experience and insight to say "I think C++ is bad because X, Y, Z" or "I think C++ is good because A, B, C which Java doesn't have".

You still have a lot to learn, young grasshopper.

  • 2
    It may not be a "bad" language if you ascend to the "bad is subjective" philosophy, but for virtually every combination of technical concerns, there is a more-productive, safer language. In my opinion, the reason C++ is taught is because it's what people use, and it's what people use because it's what people know, and it's what people know because it's what universities teach. Aside from popularity, C++ has no substantial merit that I can see, and I program with it professionally.
    – weberc2
    Commented May 10, 2013 at 21:46

Simply put, it's a very good teaching language because it doesn't hold your hand. People who learn to drive on a manual transmission have almost no trouble their first time in an automatic, but the reverse is not true. It takes longer to learn, but in college you have 4 years of toy programs to practice on before you have to make anything useful.

  • 9
    I’m worried by the fact that this false analogy has garnered so many upvotes. This isn’t how learning works. One of the many misconceptions of didactics. Commented Aug 26, 2011 at 13:00
C++ isn't that bad. 

What is being taught in school is usually driven, by what the professors know, and what was being used in the industry and popular at the time.

Think of schools as a time capsule to the past. :)

I really wish it was the other way around.

  • a very sensible point ! I was not given any exercises on smart pointers or RTTI or RAII in college. WTF !
    – Chani
    Commented Oct 7, 2012 at 18:40

English has also been described as a really bad, hacked together, inconsistent language, but since so many people around here know it, my parents and teachers decided it was a good idea to teach it to me.

I think it's the same with C++. It's a language that a lot of people know, so it's worthwhile getting a basic fluency.

It also has the advantage of being low level enough to really give you a feel for what's going on at the hardware level.

Finally, it doesn't have the "commercial" issues that some other languages have (like Java-Oracle or .NET-MS). I know a lot of universities wouldn't want to be accused of teaching one specific company's product over another one.

  • 1
    +1 for c++ not being a commercial language. It is good to learn a language without worrying abt the politics and business tactics. <installing Java7 on Linux for example>
    – Chani
    Commented Oct 7, 2012 at 18:41

If C++ is so bad, how do you explain that most software products you use in your daily life are written in C++?

There may be several reasons to learn C++ in college from the first year:

  • It's largely used. The existing codebase is just huge, and even now that there are languages as Ruby, Python or C#, C++ is still used a lot even when creating applications from scratch, including for the websites. In this case, learning C++ is a good choice. At least a better one than spending two years learning Ada, i.e. something you will never use in your life, unless you develop applications for spacecraft.

  • It's not too abstract. For example, how can you explain to students what are pointers if they've learned only C# or Java?

  • It is difficult enough compared to, say, PHP. It means that students who are not made for programming will leave soon, which is not so bad and avoids for a student to waste two or three years before understanding that software development is not for him.

This makes C++ more suitable than Ada, Java or PHP.

  • 1
    It seems like C would be better for your second two points. Are there schools that teach Ada? I would definitely take that over C++ but then again I'm weird!
    – Jetti
    Commented Jul 25, 2011 at 18:18
  • C++ is selected for commercial products because it's what more people know, not because of its technical concerns. C++ is an unsafe, hard to use language compared to many modern languages. Languages aren't selected on their merits but because they're popular.
    – weberc2
    Commented May 10, 2013 at 21:50
  • Furthermore, I can't think of many things Ada does worse than C++, and I would much rather use it than C++ (my code would be simpler and safer, anyway), and I program in C++ professionally! And for teaching students about pointers, there's always Ada, Go, or any of a number of sane languages. And regarding your last point, C++ is needlessly difficult. Many of the problems C++ programmers face have nothing to do with programming, but with overcoming C++. Programming at any level is fairly straight forward in a sane language.
    – weberc2
    Commented May 10, 2013 at 21:56

Generally speaking, if you can learn and master C++, you can learn and master pretty much any other language out there. The reason it's disliked is because, in order to be proficient in it and have a fast release time, you need to be very familiar with the language and it's standard library.

However, in a language such as Java, you can have a fast deployment time with only some advanced knowledge of the ins and outs of the language/standard library. Hell, I only know like five things from the Java standard library by heart (asides from the basic stuff like collections of course).

That being said, C++ is still a widely used language because of it's great combination of speed and object-oriented methodologies. While many people believe it's not full OOP, I believe it gives you most of OOP's flexibility without forcing you to be a total fanatic. Most compilers even allow you to write pure C.

If I had the choice, I'd take C++ over Java any day, but that's just me being a fanboy. Generally speaking, Java is useful because it will run on pretty much any architecture that has a Java interpreter built for it. So for client applications that need to be supported on multiple platforms, it's considered the best tool for the job and most new applications written are web based anyways.

  • It may not be true of the object code, but the promise of C languages including C++ back in the day was that there were compilers for just about every platform so the same source code could be used to compile applications for a wide variety of platforms.
    – JohnFx
    Commented Jul 25, 2011 at 22:34
  • That is in-fact true. Most *NIX platforms have built in compilers and that tends to have a psychological effect on most people in the form of "Sure, I could download THAT compiler, but this one came with my OS so surely it must be the best".
    – user32288
    Commented Jul 26, 2011 at 2:00
  • You should try other languages besides Java--there are alternatives that make up the best of both worlds. Go for instance offers speed, portability, and simplicity and it makes concurrency a breeze.
    – weberc2
    Commented May 10, 2013 at 21:58

As some of my professors have told me, it is easier to start from the bottom, or a low level, and then work your way up. A language like C++ gives you a great introduction to what being a computer scientist is really about. It may not be as glamorous a language as Java, Python, Ruby, etc... but it allows you to gain a core understanding of important program features such as pointers and memory management. Even if it is not a language you plan or want to use for the rest of your life, you will appreciate in years to come when you start to find your desired programming path.

  • This sounds like an argument for Ada, not C++...
    – weberc2
    Commented May 10, 2013 at 21:59

C++ can be one of the simplest languages for beginner level console programs. Sure the language is complex, but you can focus on a procedural subset. You can ignore the existence of pointers for quite a while. You can start of simple, then build.

There is less "fluff" syntax for getting that initial "hello world" program up and running compared to java or C#. Should a beginner have to see the word "static" for a hello world app? In java/C# they do.


When I studied computer science, Java was tought first, but my university right now teaches two languages to us computational linguists: first Prolog and then C++.

C++ is taught for (at least) the following reasons:

  • It's a general-purpose language, you can write software for any operating system with it (because there exist many compilers). It is designed to be a good production language, it makes it easy to re-use program parts, interoperate with real-world hardware and software, etc.

  • It's really fast. You can't use Python or Scheme or Prolog for processing huge data sets, which are common these times. Think graph algorithms with millions of nodes. (That's also why computer games are usually written in C++.)

  • Students can learn what the compiler does. Actually, as long as I only learned Java (starting in high school), the compiler's work always seemed like magic to me. You just don't learn about the stack and heap, the whole static vs. dynamic linking thing, etc. as a Java beginner. C++ de-mystifies the whole computer.

  • For what it can do, it is ok in learning time (although it is probably one of the most complicated languages if you really dig into it). It offers a nice library which helps with a smooth learning curve. (There are different approaches to that, though. In my university, we were taught how to write our own string classes and smart pointers before we were allowed to use the library; Bjarne Stroustrup, the inventor of C++, encourages the opposite order.)

  • This doesn't explain why Ada, for instance, isn't taught as the first language.
    – weberc2
    Commented May 10, 2013 at 22:06

C/C++ is actually a better language than most others, firstly because it does not add a false sense of security. Secondly because you have tho know what you're doing.

I actually love the language, and I consider it superior to most alternatives.

It's also as productive as most other languages, and not that "crashy" if you know what you're doing, and think before you copy-pasta random codez.

Also a good read - http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html

However, some things in C++ are actually bad, for example exceptions, and unintuitive overhead in some cases. This is the reason, I guess, why Linus is so negative about it in the post you quoted.

A good read to touch one of the related topics - http://blogs.msdn.com/b/oldnewthing/archive/2004/04/22/118161.aspx

  • 3
    This answer is just completely wrong. First and foremost because there is no language called “C/C++”. Commented Aug 26, 2011 at 14:46
  1. Professors don't like to prepare a new course and there are limits to how much you can offer.
  2. Languages come and go, so they gave up trying to stay on the cutting edge (See #1)
  3. It's a university and not a technical school. More focus on providing a foundation than job training.
  4. Covers a wide enough range of programming: server, desktop, embedded, UNIX, Windows.
  5. They use it as a weed-out course. Every major area of study has at least one.

Earlier there was Pascal, earlier Pascal there was a something alike Basic. The interesting part is - what next ? Maybe nothing. I have an though about "why c++". Because it's hard but it's not to hard alike lisp. No, I really understand that C++ is good language for system programming, I know that there area lot of projects coded on C++ and there a are tons of libraries so the students can create everything with it. But we are talking about students and their possibility to create logics and understand the system. You can't be a good C++ coder if you can't create simple logics and understand how the system works and that is a main reason in my opinion. And yes, another simple reason is stable career start.

Not the answer you're looking for? Browse other questions tagged or ask your own question.