News for hackers. Stuff that matters.
Re:NASA C Style Guide [pdf] by thewisenerd on Saturday November 19, 2016 @06:03PM (#12996233)
How strictly do people writing code have to adhere to styling guides (not just in NASA, but everywhere else too)?

I get that coding standards are a good thing and plain-simply following these will produce "readable" and (possibly) maintainable code, but will that make the code any _better/efficient_ ?

Though this does catch some "gotchas" in C, like the if-if-else and the #define trap, I wonder if the Code Review involves a guy rejecting my patches with the comments, "you have missed out guideline 6.4.3.5 defined in page 54".

Re:NASA C Style Guide [pdf] by technion on Sunday November 20, 2016 @04:04AM (#12997995)
There is nothing more annoying than getting a PR that fixed a one line bug, along with someone's editor's autoindent rewriting the entire file the fix was in, because it wanted to change indents.

It's certainly not efficient reading a patch with a +1000/-999 diffstat, hunting for a one line fix. I've had this repeatedly and it's painful. Anyone that noted the existing style wouldn't have let this happen.

Re:NASA C Style Guide [pdf] by astonex on Saturday November 19, 2016 @06:49PM (#12996407)
Generally, code that does not adhere to the project's style guide will not be merged until it's fixed.
Re:NASA C Style Guide [pdf] by knodi123 on Sunday November 20, 2016 @12:14AM (#12997381)
If programming in Ruby, I find that rubocop can enforce our style guide programmatically and impersonally, and it can even be set up with a git commit hook. You can't push ugly syntax! It's not perfect, but it's very good with very little effort.