# C and C++

> Two old, fast languages that sit underneath operating systems, browsers and games.

- Level: Intermediate
- Topics: Software
- URL: https://tidbit.legios.com.ar/c-and-cpp/
- In Spanish: [C y C++](https://tidbit.legios.com.ar/es/c-and-cpp/)

**C** is a programming language created by Dennis Ritchie at Bell Labs in the early 1970s to write the Unix operating system. **C++** came next: Bjarne Stroustrup started it in 1979 as "C with Classes", adding object-oriented programming and many other features on top of C. They are different languages, but C++ can use C code directly, so they are often named together.

Both are compiled straight to machine code and give the programmer direct control over memory: you ask for a piece of memory, you use it, you hand it back. That control is why they are fast and why they run where little else fits, from microcontrollers to the Linux kernel. The cores of Windows, macOS and Linux, browsers like Chrome and Firefox, many databases and most big game engines are written largely in C or C++.

The price of that control is risk. Forget to hand memory back, or read past the end of a list, and the program can crash or, worse, open a security hole. A large share of serious security bugs in big C and C++ projects come from exactly those mistakes, which is why newer languages like Rust aim for the same speed with memory safety built in. Still, decades of working code mean C and C++ are not going anywhere.

## An analogy

A manual car with no driver aids. An expert gets every bit of performance out of it; one distracted moment and nothing stops you from stalling, or worse.

## Keep in mind

- C dates from the early 1970s; C++ was built on top of it starting in 1979.
- Both compile to machine code and manage memory by hand.
- Operating systems, browsers, databases and game engines are largely written in them.
- Manual memory handling is the main source of their crashes and security bugs.

## Go deeper

- [C (programming language) on Wikipedia](https://en.wikipedia.org/wiki/C_(programming_language))
- [C++ on Wikipedia](https://en.wikipedia.org/wiki/C%2B%2B)
- [Standard C++ Foundation](https://isocpp.org/)

## Related terms

- [Programming language](https://tidbit.legios.com.ar/programming-language/): A precise, written language people use to give instructions to a computer.
- [Operating system](https://tidbit.legios.com.ar/operating-system/): The base software that runs a device and lets every app share its hardware.
- [Object-oriented programming](https://tidbit.legios.com.ar/object-oriented-programming/): Organizing code as objects that bundle data with the actions that use it.
- [Microcontroller](https://tidbit.legios.com.ar/microcontroller/): A tiny, cheap computer on one chip, built to control one specific thing.
- [Linux](https://tidbit.legios.com.ar/linux/): A free, open source operating system that runs most of the internet's servers.
- [Cores and threads](https://tidbit.legios.com.ar/cpu-cores-and-threads/): Why a CPU is really several processors, and why it can juggle even more tasks.
- [Web browser](https://tidbit.legios.com.ar/web-browser/): The app that fetches web pages from the internet and draws them on your screen.
- [Mozilla](https://tidbit.legios.com.ar/mozilla/): The nonprofit-owned organization behind the Firefox browser and an open web.
