r/C_Programming • u/alex_sakuta • Jul 19 '26
Discussion Why are you using C?
I have been often asked this question in the one year that I have been trying to make using C mainstream for myself.
Now I don't work on embedded devices or write operating systems. What I usually make are automation CLIs or write servers for something.
I guess that makes using C redundant since there are languages that would provide a better dev experience. But following the popular advice for projects, make something you use, this seems like the right thing to do for me.
I'm making projects that I would use and I'm using C for them. Unlike most C users that I have talked to, I do not stick to C99 but at the same time, I don't use C++ strings or compiler extensions. I use the C23 strict ISO standard.
So I suppose that again puts me in a spot that no one else is in. A guy who first goes to one of the oldest and verbose languages, then uses its latest standard but then never uses advanced features from compilers.
I just wanted to write this to put it out.
PS: To add to my strange choices pool, I do not use fixed width integers, since they are optional but I do use least width or bit precise integers.
49
u/gm310509 Jul 19 '26
If you think C is verbose, you should try looking at COBOL.
30
u/Mental_Pick1943 Jul 19 '26
I use C because it is fast, simple, and I enjoy writing in it. I also do work on embedded devices sometimes so there is that. I find C++ to have too many features for my liking, although it can be useful in certain cases. As for other languages, I use python sometimes to throw together random scripts but that is about it, I don't have any active projects which use it as a main language.
47
u/Harha Jul 19 '26
I use C99 for video game projects because I like its simplicity.
18
u/Kseniya_ns Jul 19 '26
I am asked this also, and I answer that is using C for compatibility, but so that by being written in C, we can employ C developers. And is much beneficial to have a C guy, than something else.
14
u/HowTheKnightMoves Jul 19 '26
Well C in embedded systems puts food on my table, but its so simple language that makes you relax. Recently tried C23 and I really liked it (constexpr and defining enum size are pretty useful for me).
Its close to hardware and syntax does not make you want to jump out of the window the moment you need to do your work. I cannot be that nice to C++ and not self combust.
5
u/octod Jul 19 '26
Using it for my pet project (a 2D/3D game engine) because is a simple and fun language.
5
u/Leading-Compote3042 Jul 19 '26
Using C for work since it is dealing with embedded systems but same core codebase and application is also cross platform and compiled for Windows, Android too. Staying with older compilers mandates not using newer versions. We bolt on different GUI layers as needed, which can be using other languages. The core business logic remains in C and some C++ too. This repository is getting to the point of 20 years on the go and still actively developed and evolving. This is where C language shines, portability.
5
u/an0rak_dev Jul 19 '26
I use it for video games / embedded (Oculus Quest)
Because I need something without any transpilation or hidden cost. When i code, I know what the produced ASM will look like and I can optimize it for the comfort of the end-user, and not only the one of the developer.
4
u/awsq_code Jul 19 '26
i use c89 with compiler extensions like {[] =} or ... but i thinking to replace it with p99 lib or something else
2
u/paulys_sore_cock Jul 19 '26
I'm a EE. I use whatever tool is correct for the job and if there is no tool, I make one.
I write a lot of drivers, kernel code, and on the boundary of asm. C lives there, because I care about how the actual HW treats 8 bits. I do not care about data struct semantics. I care about the state of the reg.
I write a lot of proofs. I'd never ever use C for that.
I sometimes write web scrappers. I'd never ever use C for that.
When I "think" in code, I "think" in C. Writing idiomatic python is a pain for me, because I don't think in factories. But, I can do it.
When you are doing something you should ask yourself: are you doing this for the achievement / badge at the end (aka getting to tell the 'net that you wrote a no-sql CMS 100% in C99) or are you trying to get the job done?
If it is the latter, your question is meaningless.
2
u/cbf1232 Jul 19 '26
You do you, but I'd be asking why not Go or Rust?
2
u/jefflegex Jul 20 '26
I like that it doesnāt have the complexities (especially syntactically) of other systems languages. I still use JS/node for scripting instead of python because I am more comfortable with that. C is for any real programming I do
2
u/randomfuckingpotato Jul 21 '26
I use C because I can't afford adhd meds šššš
7
u/neopunk2025 Jul 19 '26
I'm using the C programming language for my next game on Meta Quest. In my previous game (www.neopunk.xyz), I used C++. I love the simplicity of C, which lets me write code without any unnecessary complications (like C++).
6
u/robthablob Jul 19 '26
"A guy who first goes to one of the oldest and verbose languages"
C is neither one of the oldest, nor one of the most verbose languages.
It's generally quite concise.
4
u/lev_lafayette Jul 19 '26
Pretty extensive in scientific applications built for performance, especially math libraries.
4
u/mivanchev Jul 19 '26
Not using extensions is quite weird because they turn the language into something useful and enjoyable. I wouldn't consider using C without extensions although C23 really addresses some points.
4
u/Olovico75 Jul 19 '26
Determinism, Thread safety, no floats,
Such requirements in a specific project make C mandatory in my workflow.
I personally use C for Pro audio and DSP engineering. And honestly, I barely see no practical way outside of c99/c11 for what my specs and mandatory requirements currently enforce. ( see GDVP.net/engineering if you are interested by my take as this is my solo project )
4
u/dallascyclist Jul 19 '26
Because they deprecated BCPL.
1
u/LaidBackDev Jul 19 '26
I'm using C to demystify it for myself. At first I didn't wanna learn it because a lot of people in the internet make it sound like C is from the Jurassic period and that it's difficult but after learning it myself, yes it was hella hard but after understanding stack and heap memory and getting used to the syntaxt I realized its not really that frightening.
3
u/andful Jul 19 '26
Interoperability. C is the lingua franca of computers. I don't have to deal with name mangling when calling from a different language.
5
u/kchug Jul 19 '26
I write and have been writing all my code in c for over 13 years of my career! Currently working on a scale out nvme system based on spdk! Iāve written kernel modules and parts of file system in c! I am very much enjoying the asynchronous programming scheme that spdk threads provide!
2
u/Vivid_Extreme7419 Jul 19 '26
I program embedded so itās practically compulsory to use but I also love C programming so it works out
2
u/Genrawir Jul 19 '26
Because Linux is written in it, and that's what I'm trying to teach myself more about.
2
u/Nerobot3 Jul 19 '26
Because my assembly code is shite.
2
u/junipyr-lilak Jul 19 '26
I use C because I am rebuilding my programming knowledge and experience from a new base, instead of JavaScript it's now C. My plan is to continue using C but I also wanna branch out and work with other low(er) level languages too, including C++, Java, C#, Objective-C, Rust, and Go. Using C and having it do actually fairly little for me by being so straight forward means that I do have to get down to orchestrating things but that also helps me hone in and do my projects. As well, the types keep my focus on the structure of a program, better than TypeScript has for me so far, and in the end I actually have a working project instead of something I've given up on part of the way through. I still will work in JavaScript and webdev stuff but bringing back what I learn from C and others will hopefully shape how I work with websites
2
u/Odd_Concentrate_6290 Jul 20 '26
I use c programming for embeded systems avonics project. It's very simple and fast. Love it.
2
u/jwzumwalt Jul 20 '26
2
u/LordRybec Jul 20 '26
I use C for a number of reasons. First the obvious ones, I do embedded programming a fair amount, and I often do low level stuff. I also do games sometimes, and contrary to popular belief, C tends to be better for that than C++. (People who use C++ for games rationalize it with the superiority of object oriented programming for games. I personally find that object oriented programming is bad for games and encourages bad habits that make them even worse. Also OOP comes at a pretty heavy performance cost, due to OOP being extremely poorly suited to good cache coherency.)
Additionally:
I learned C++ as the primarily language taught in my undergrad program, and honestly, it's harder to write and read than C. Sure, objects, operating overloading, and so on, but those don't actually make the programming easier, and they make debugging much more difficult. (If you want to fully understand why C++ is much harder to debug, watch this: https://www.youtube.com/watch?v=sfrnU3-EpPI ) I'm quite good at programming, but my skill and speed increased dramatically when I moved to C. In addition, I spend far less time debugging, and I almost never have to pull out a debugger, because everything is explicit.
For my work, I do a lot of bitwise number manipulation. This requires fixed width values (I literally can't do some of the stuff in Python, due to it having variable length integers), and the ability to smaller width sub-pointers into values is incredibly useful. (Like, I can take a 64-bit uint and create four 16-bit pointers into it, to independently work on different parts. This is really useful when you want to do shifts or rotates of one part without it bleeding over into others.)
The other language I use a lot is Python, and Python has really solid interoperability with C. So if I need to a) streamline part of a Python program or b) compile part of a Python program to obscure it, it's easy. I write the part that needs special treatment in C, turn it into a Python library, and now I can load it from Python. Of course, the reverse is true a well. Some time ago I had an application that needed some networking stuff. Networking can be a pain in C and isn't very portable, so I wrote most of the program in C, turned it into a Python module, and then implemented the networking part of the program in Python. From there I could easily pop in and out of the C level code, doing the networking in Python and everything else in C. (And I could instead have pulled Python into C, but for my uses, it was easier to make the C Python module.) This interoperability gives me the various benefits of C (mainly performance) where needed as well as the fast development time of Python everywhere else, which is awesome.
Those are my reasons. Different people have different strengths and weaknesses though. I know people who really strongly prefer languages that provide objects (and when I'm working in Python, there are times where objects are the right choice), who would struggle with C. I work especially well at the C abstraction level, so that's where I generally prefer to live, but there's nothing wrong with different preferences. (I also am quite comfortable working in assembly, when the opportunity presents itself.) That said, anyone who enjoys programming but hasn't tried C should at least learn it and do maybe one project in it. A surprising number of people on this and other C related subs (and Twitter) come from higher level languages and end up loving C and wishing they had discovered it sooner.
2
u/P-39_Airacobra Jul 20 '26
While C is technically not that close to the metal, in practice it was made with the machine in mind, so it feels low-level and simple. Thereās a lot of syntax and undefined behavior I would remove if I could, but it could be much worse so I wonāt complain too much.
2
u/heavymetalmixer Jul 20 '26 edited Jul 20 '26
As someone whoe wants to make their own game I'm really worried about performance, and that took me to the topic of manual memory management, which resulted in me making my own custom allocators.
I started with C++ but came to realize I hate OOP, exceptions, RAII and many of the choices taken by the C++ Comitee, so I went with the more simple yet stablished option: C.
I definitely like it more than C++ but I can't deny I miss some features, mostly because C's standard library is really barebones. It's true that I need to write many things by hand that already exist in C++, but I can choose how to design and implement them without the fear that another developer will "ruin" my code by using a completely different way of doing the same thing (a very common problem in C++, and one of the reasons why many C++ devs preffer C libraries).
My favorite C version is C17, it's quite "modern" but also focused on being as stable as possible (it's basically a bug-fix version for C11).
2
u/unkindle_blue Jul 20 '26
Because Linus Torlvads Likes it
2
u/Traveling-Techie Jul 19 '26
Malcom Gladwell in āBlinkā says it takes 10,000 hours and 20 years to master something. Iāve got about 4x that experience with C so Iām most comfortable with it. Turing in 1936 showed that all fully programmable systems are equivalent except for efficiency and capacity (time and memory) so arguably language choice shouldnāt matter much.
0
u/chrism239 Jul 19 '26
You just sound very confused.Ā
1
u/pillsburyboi Jul 19 '26
Using it for BareMetal SOC verification. :)
1
u/jerrygreenest1 Jul 19 '26
C programs have the best cold start, which for a thing such as CLI tools is really important because in a modern ADHD world when you want to do all the things asap, the snappiest feedback is extremely important. Things gotta be fast.
Also if you look at benchmarks, you will see how C outperforms everyone in pure calculation, like for example it beats everyone in calculating PI numbers, at least in single-threaded benchmarks. Itās just really fast indeed. It starts fast, it executes fast.
One little area where C isnāt the strongest is concurrent/parallel/multi-threaded calculations, and itās not because it performs bad in there but because the programs will just get much more complicated. Although there are libraries for that but thatās what I heard anyway. I never actually tried to write multi-threaded C programs myself because I fear the hardships of the task. But writing single-threaded extremely snappy CLI tools that will give the lowest possible latency?Ā Yeah thatās why I use C. For little tools itās just ideal.
For big tools itās also a great language but in this case it is also a great liability. Writing simple programs in C is simple. But writing hard programs in C is extremely hard.
1
u/my_password_is______ Jul 19 '26
LOL @ verbose
have you seen Java ????
1
u/LooksForFuture Jul 20 '26
I use C for desktop development and game development. I have also started to do scientific computing in C.
1
u/pedersenk Jul 20 '26
The dev experience usually comes second to the user and deployment experiences. A bunch of i.e Python pip commands is not as resilient as a self-contained executable during deployment stages.
This is the primary reason why we write in homogeneous C for our libraries at ${WORK}.
1
u/didntplaymysummercar Jul 21 '26 edited Jul 21 '26
A few reasons. Portability (almost every V++ compiler can do C89/C99 but there are a few C only compilers), practice (my main languages are C++ and Python), since it's simpler so it constrains you a little when making small things so you don't overcomplicate them. I've learned C++ a long time ago so I got C for "free" almost and I like it. Low level libraries, Lua and Python runtimes and OS APIs are in C too.
It's also future proof. Between it and my favorite old Lua 5.1 (written in C89 with no dependencies) and maybe C++ as long as dependencies aren't a problem your code will work forever. Python maybe could do the same (for pure Python I would kinda trust it still) but I once wanted to try something on 2.7 and couldn't build it, either it required 2.7 to bootstrap or dependencies were missing, obsolete, rewritten in R*ust, etc.
Between portability, OS access and stuff like zig cc cross compiling or nullprogram's w64devkit it's perfect for making tiny CLI (or GUI WinAPI) utilities that (if you go for freestanding) are few dozen KiB at most.
1
u/are_number_six Jul 21 '26
I learned Python first, then had to learn micro-Python for an embedded project. That didn't really make sense to me, so I found C. I really liked it and have stuck with it.
1
u/pconroy329 Jul 22 '26
if I need a 98k executable, I write it in C. If I'm after a 98M executable, I write it in Java. If I don't care about size or speed, I write it in Python.
1
u/BumpyTurtle127 Jul 23 '26
Cuz it's still the standard in embedded
1
u/czlowiek4888 Jul 23 '26
Did you heard about Odin? It's pretty nice alternative.
1
u/No-Trifle-8450 Jul 23 '26
Why not? C is blood of other programming languages.
1
u/sreekotay Aug 01 '26
C is one of the few programs where the intent of the program and algorithm are not overwhelmed by the mechanisms and bookkeeping of the langugage
1
u/bapee0_ Aug 07 '26
La verdad que a mi me encanta C
2
u/azurfall88 Jul 19 '26
It's easier to do memory fuckywuckery
0
u/[deleted] Jul 19 '26
[deleted] ā view deleted comment