C Development is a Mess
Tags: c, cpp, coding, discuss
Published: 2023-07-11 17:41:49

Hey folks, it's been a while since I posted here! I've been quite busy with life, especially working at a few companies such as [Hyperbeam](https://hyperbeam.com), [DigitalOcean](https://digitalocean.com), and a few others. That being said though, let's get into the real meat of today's topic. **Why is C/C++'s development such a mess?**

## Build Systems

One of the biggest pain points of C/C++ development in my opinion is the build systems, there is many, many build systems, a lot of them not being compatible with the other. We have CMake, Premake, Xmake, MSBuild, Bazel, and many others. This has practically resulted in that popular XKCD comic about standards where they just add to the mess.

![XKCD comic about standards](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1hy01bhd9x1ie4h17bl.png)

This is not the way to handle things, creating yet another build system or project configuration system will only result in yet another attempt at improving the situation, at the cost of making it worse instead. What actually needs to happen is for there to be one, uniform build system. Let's take a look at other languages: Rust has Cargo, Zig has it's own built-in build system, Haskell has stack, Hell, even Fortran which is older than C/C++ has it's own known as FPM! My point being **creating more is doing less**.

## Standardization

Another problem is that C, but especially C++ has feature creep. Now this is quite normal in the C/C++ ecosystem. But this has resulted in compilers [not being able to fully implement standards](https://clang.llvm.org/cxx_status.html). By the time a compiler catches up to the current standard, a new standard is already out. This is why a fair amount of people tend to prefer to stick to one standard and not move to newer ones, because it's consistent.

The point of a standard should not be to **expand** the language or tool, but rather to, as the word implies, set a **standard** in which compilers, and related tools can stick to and follow a written down point of truth. This is not entirely possible when every time that point of truth has been followed, a new one is made which may completely eradicate any previous truths.

## Compiler Compatibility

This might be a hot take, but personally I hate compiler specific extensions such as GCC's [C Extensions](https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html). The reason for this being it causes your code base to only be compatible with that specific compiler, and no others. This means for anyone using Clang, TCC, MSVC, or other C toolchains, they are shit out of luck unless they install GCC. I shouldn't need to install X specific compiler for the language I'm compiling when I already have a compiler for that language installed on my system. If the extensions were shared across compilers and toolchains however, that would be great!

## Package Management

I touched on this in the first section about Build Systems, but we're going to dig into this a bit more as it's always been a bit of a sore spot for me personally. Package management in C, in all honesty, sucks. There is no central place to *search* (not get) packages, due to the build system mess, you run into packages using X build system which you may not be using so you have to port their build script to your build system, package management is inconsistent across platforms (although microsoft's [vcpkg](https://vcpkg.io/en/) attempts to fix this), and there's many more issues that you have to deal with due to inconsistencies, too many options, and other issues that affect it.

## Final Words

What do you think? Do you think C/C++ development could be improved, if so what is your opinion on *how* it could be improved? Reminder to stay chill, don't attack people for giving lighthearted opinions. This is my opinion as someone who has done C/C++ development for years, and obviously doesn't reflect the opinion of others.