▲ | awesome_dude 9 days ago | ||||||||||||||||
> Our coding standards require that functions have a fairly low cyclomatic complexity. The goal is to ensure that we never have a a function which is really hard to understand. https://github.com/fzipp/gocyclo > * We also require a properly descriptive header comment for each function and one of the main emphases in our code reviews is to evaluate the legibility and sensibility of each function signature very carefully. My thinking is the comment sort of describes "developer's intent" whereas the naming of everything in the signature should give you a strong indication of what the function really does. https://github.com/mgechev/revive > Now is this going to buy you good architecture for free, of course not. It's not architecture to tell people to comment on their functions. Also FTR, people confuse cyclomatic complexity for automagically making code confusing to the weirdest example I have ever had to deal with - a team had unilaterally decided that the 'else' keyword could never be used in code. | |||||||||||||||||
▲ | arbol 9 days ago | parent | next [-] | ||||||||||||||||
I can understand why else is sometimes not needed. JS linters will remove unnecessary else statements by default. https://eslint.org/docs/latest/rules/no-else-return#rule-det... But never using it is crazy. | |||||||||||||||||
| |||||||||||||||||
▲ | jonahx 9 days ago | parent | prev [-] | ||||||||||||||||
> he weirdest example I have ever had to deal with - a team had unilaterally decided that the 'else' keyword could never be used in code. Not weird at all: https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea... | |||||||||||||||||
|