My C23 Conventions

32 points by abnercoimbre


tomsmeding

Years ago I was severely distrustful of any kind of zero initialisation in C, mostly since I could never remember which magical incantation ({}, {0}, were there edge cases?) did the trick, and would write an explicit memset after the variable declaration. Then I got tired of that, found the correct syntax, and wrote {0} instead.

Now I wonder if the problem is C, not me.

nytpu

I use C23 religiously almost exclusively because of constexpr giving truely compile-time constant expressions lol, was very desperately needed for a long while. I always despised having to abuse anonymous enums to get true-constant integers (still better than preprocessor since they're actually a language feature and as such show up in debuggers and such) and then use the preprocessor for any other kind of constant. (const objects are just "immutable", not actually a compile-time constant; so you can't necessarily use them for things like static array lengths)

alterae

i do appreciate that these all seem to boil down to just "using c23"