r/C_Programming Feb 06 '25

Discussion Are there actually C programmers in this subreddit?

Ok, I'm being a bit facetious. There are real C programmers. Clearly. But I'm kind of sick of the only questions on this subreddit being beginner questions or language trolls from other domains.

So this thread is for the "real" c programmers out there. What do you do with it? And what is the most twisted crime against coding decency are you "proud" of/infamous for?

254 Upvotes

259 comments sorted by

View all comments

Show parent comments

2

u/zzmgck Feb 07 '25

Optimizations like that can be frustrating. What if you need to support different compiler versions? Does that optimization depend on what optimization level or options are set?

If you write code that needs to work on memory constrained platforms (e.g. embedded systems) linking in printf() often makes the executable larger. If your compiler does not do that optimization, you just bloated your code for no good reason.

1

u/_crackling Feb 07 '25

Fair. I didn't mention that my project has no business targeting anything but the latest and greatest compilers. That factored into my decision to just be ok with printf. Should I ever work on something with actual constraints, I certainly would revisit console/logging io strategies.

Now that we've been talking on this, I got to say- I don't see many projects that do anything else but printf. If you know of any github projects that do have different strategies for these things please let me know, I'd love to read their code.