C++ Is Not The Same As C

This is something of a useless rant, in that few people care anything about the topic, and there is almost certainly nothing that will change as a result of my posting it.  However, it may help me get it off my chest, which would be a good thing.

Throughout the Internet, I am constantly encountering titles, comments, notes, headers, and so on, with the text: C/C++.”  For example, if there is a listing of programming languages, you might see:

  • Python
  • Perl
  • Fortran
  • Cobol
  • C/C++

In almost every case, C and C++ are together as C/C++.  The idea is that C and C++ are so similar that when you talk of one, you might as well be talking about the other.  This is wrong.

C is a venerable old language, created by Dennis Ritchie back in the 1970’s.  That’s in the Stone Age, as far as computers go.  It’s an ancient language, but it’s still used in many places.  The Linux kernel is written in C; many compilers are written in C, including some C++ compilers.

C++ is founded on C, and has many similarities.  However, it is a different language.  C++ allows object-oriented programming; it has classes and methods and all sorts of stuff that C never had.  C++ is useful in some applications, especially large and complex ones.

The uses of the two languages can overlap somewhat, but honestly each has its own niche.  C is best for system programs, device drivers, anything that requires using the least amount of memory, or the greatest speed.  C has been called a “high-level assembly language” because it allows you to take advantage of the computer’s hardware features.

C++ is much larger than C.  It takes up more memory, and it is generally going to run more slowly than C.  C++ can be used for such things as highly complicated, large projects where the use of objects makes sense.  You lose a little speed, but you make up for it in having your programs better protected against many types of errors.

These two languages have their place.  Neither is “better” than the other in general.  But for God’s sake, quit lumping them together as though they were almost the same thing.  They are not.

This entry was posted in Rants. Bookmark the permalink.