My C source file format preferences
Formatting is not something developers should be spending much time on, but we spend a lot of time staring at code to see if it's right so the formatting needs to be pleasing to the eye. As such, many of the format options are subjective, with many developers' preferences coming from what they have been trained on in books and coursework as well as previously encountered codebases. Here I will attempt to justify and explain my choices. BreakBeforeBraces: Allman Allman/BSD style has the advantage that the braces line up vertically so you can see that they are in matched pair. I find the offset placing that you get in K&R, One True Brace, Linux Kernel, Stroustrup, BSD KNF, Pico and Ratliff displeasing due to both the asymmetry of the brace positions for the block (sometimes called Egyptian braces) and the…
Continue reading...