Maybe
there's no book for that, it's just programming experience... am I
right? (I hope not! xD)
Thanks in advance,
A student who is a bit confused about which is good modern C
programming style... :-)
I don't think there is any such thing. These days coders type first and avoid thinking in order to create as much code as possible (thus the perceived importance of "code completion"). But *good* programming style hasn't changed.
Think. This is painful for us barely intelligent creatures, and costs time up front, but saves time down the road.
Factor. Write *very short* independent functions. My old friend and colleague Jon Sachs, the programmer who wrote the classic "Lotus 1-2-3", liked to point out that capability of well-factored code increases exponentially with the size of the code: there's a "combinatoric explosion". But we see in the modern "code first, avoid thought as much as possible" approach that the code size increases exponentially with capability. Not good.