3 ms·
This coding style works, sure. But so does the NT kernel style, which is the opposite of Linux kernel style in many ways. For example, in NT, all structs and po
by quotemstr 9y ago
This coding style works, sure. But so does the NT kernel style, which is the opposite of Linux kernel style in many ways. For example, in NT, all structs and pointers are typedefs. So what? There's a certain elegance to type names being one token long.
People bikeshed source code formatting. They make arguments about developer portability and visual minutiae, usually without any sort of evidence, when in reality the higher-level organization of the code matters a lot more. Optimizing code for readability quickly runs into diminishing returns and begins hurting a lot more than it helps.
In general, I'm strongly against rules and ceremony and centralization when it comes to coding. Ostensibly, it's all about hygiene and best practices and whatever, but in practice this kind of discipline amounts to "I like it this way and you're going to like it too". It's far more important to let developers make decentralized, rapid decisions about the best approach for a particular task than to enforce some kind of useless Procrustean uniformity on everyone.
- remline 9y agoThe two styles work because they are not being mixed with their opposite. A cached shed optimization is what makes working with others bearable.
- Analemma_ 9y agoThat’s sort of what the parent is saying: “the only code formatting rule that matters is consistency, everything else is bollocks”. But people want to think there’s some kind of higher justification for their preferred style, so they come with these just-so stories that don’t have any real evidence behind them.
- quotemstr 9y agoAlso, it's local consistency is what matters, not global consistency. Developers can adjust to slightly different coding styles when they move to a new project. They're going to have to learn new abstractions, new bits of domain knowledge, and new coworker-interaction approaches anyway. Style is a very minor concern.
- greggman 9y agoThe word consistent is an issue in and of itself. You probably mean you think it's best when a style is applied consistently. But probably don't care that the style itself values consistency. The style linked above is not remotely consistent. Braces in different columns. Braces styles for functions different from non functions. if statement can have or into have braces. All extremely inconsistent
- quotemstr 9y agoITYM "regular", not "consistent".