3 ms·
Ask HN: Which C style do you use?
Just for statistics, which C coding style do you use and why (if there is a reason other than just personal preference)? The Indian Hill Style (https://archive.org/details/indian-hill-c-style), the Linux Kernel Style (https://www.kernel.org/doc/html/latest/process/coding-style.html), other, your own style?
- lucasgonze 5y agoKernighan and Ritchie, of course. https://en.wikipedia.org/wiki/The_C_Programming_Language https://en.wikipedia.org/wiki/The_C_Programming_Language Example: https://upload.wikimedia.org/wikipedia/commons/2/21/Hello_World_Brian_Kernighan_1978.jpg https://upload.wikimedia.org/wikipedia/commons/2/21/Hello_Wo...
- youngtaff 5y agoMy preference is Allman https://en.wikipedia.org/wiki/Indentation_style#Allman_style https://en.wikipedia.org/wiki/Indentation_style#Allman_style But I tend to use K&R or what ever the project I'm working on uses as no-one else uses Allman
- floxy 5y agoYes, Allman is the correct choice. With indents being 4 spaces and no tab characters.