Blog

C vs C++ vs Python

published 2021-08-07

Overview

To be honest, it doesn't really matter which language you use. As long as you're comfortable in whichever you choose, they are all close enough that in most cases they won't have too much difference in terms of performance.

They all do have their own quirks, strengths, and weaknesses. In this post I'll talk a little about the differences between those of C, C++, and Python, three of the more popular languages.

C

C is the oldest of these three. It is also the simplest in terms of features. This makes it easier to fully understand, but also means you have a smaller palette of things to choose from when writing code.

It is strongly typed, relatively low-level, incredibly fast (the fastest of all these three if done well), and is often found in computer science programs.

In the real world though, it's not used as much as C++ or Python, mainly due to its lack of features in comparison. It's the language of choice in embedded systems, is often found in operating systems and compilers, etc.

C++

C++ is C but with more features. This has lead to it becoming far more popular, and is found in a myriad of fields including game development, computer science, operating system development, and more. It is faster than Python, but (at least in my opinion) the hardest to learn and acclimatize to.

It can be thought of as C but bigger, more cumbersome, and perhaps more powerful (in some cases).

Python

Python is by far the easiest of these three to get started in. It is fairly close to English, and doesn't have too many quirks to master before you can write basic programs.

It is also found all over, most notably in the field of computer science. It is much higher-level, meaning development using it is often faster and less error-prone. That also means, however, that you don't have as much control over the system as you do with C and C++.

Python is actually also built on C (with PyPy being pretty close to C and C++ in speed), but looks nothing like it. You can actually run C and C++ code in python though, for areas where speed and more control is needed.

Conclusion

The biggest difference between these languages is the areas where they are found. Certain fields have ceratin languages as the de facto language of their industry, while others use other languages.

In practice though, it's all about what you are most effective with.