C/C++

From Jonathan Gardner's Tech Wiki
< C(Redirected from C)
Jump to: navigation, search

Introduction

C++ and C are two different languages. There are, of course, closely related, and C++ has generous provisions to allow you to program C code within C++.

I have a very low opinion of C and C++. They are extremely difficult languages where programming errors is very easy. They require you to remember a lot of things all at once, and use a variety of mental checks to make sure that you don't introduce mistakes. In the end, the result is not worth the effort. Except in the rarest of cases, it is preferrable to program in higher-level languages, such as Python.

The only advantage of using C/C++ is that they are extremely common languages, and one of the few languages that is actually portable across platforms. (The libraries people write, however, are not.)

Syntax

The syntax is Algol-based (or so I'm told, not having seen Algol.)

Libraries

C has a set of standard libraries. These should be available on almost every platform.

C++ also has a set of standard libraries, sharing the C libraries. However, C++ also has a Standard Template Library (STL) that is extensive and complex. If you are going to program in C++, I strongly suggest you learn the standard libraries thoroughly.