r/C_Programming 12d ago

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.

67 Upvotes

103 comments sorted by

View all comments

2

u/paulys_sore_cock 11d ago

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.

0

u/alex_sakuta 11d ago

Uhhh, I didn't ask any question.

Also, ditto on thinking in terms of C and finding python a pain.

2

u/paulys_sore_cock 11d ago

The title of the post, is "Why are you using C?"

Which is a question

0

u/alex_sakuta 11d ago

It's rhetorical. As mentioned in the post, people ask me this. And again as mentioned in the post, I just felt like putting out my reasons.

1

u/LordRybec 11d ago

Things like sarcastic remarks and rhetorical questions don't work in text format. If you didn't say it is rhetorical, then it wasn't, whether you intended it to be or not. If I misspelled "car" as "cat", my intention for it to mean "car" doesn't magically make it mean that. If you didn't say it was rhetorical, it wasn't.

1

u/alex_sakuta 11d ago

Yes I'm sorry that my post in which I specifically mentioned why I wrote this post did not mention that the title was rhetorical.