Settings

Theme

What C coding style do you use (K&R, C89, C99, etc.) and why?

4 points by DenisDolya 2 months ago · 2 comments

Reader

incomingpain 2 months ago

When I learnt C via the "learn C++ in 24 hours" type book. It was heavily C99, c11 wasnt a thing yet, oh hey what's that grey hair. I later actually went more GNU style. More functional C vs object orientated like C++ that they taught. I practically never coded a class in C.

I havent coded in C in over 10 years now. I view it as a dead language. If you really need C-like language. Definitely go rust, no question.

Today if im not coding in python, it's html/css templates being used by python.

JohnFen 2 months ago

If I'm programming with/for others, I use the style the team has adopted. If I'm working with existing code, I maintain the style already used by it.

For my own projects, my preferred style isn't purely any of the ones you list. It's a mongrel style. I do it that way because I choose my style elements to most closely match the way my brain works.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection