by rootlocus · 10y ago · 0 comments
> The answer to that is that if you need
> more than 3 levels of indentation, you're screwed anyway,
> and should fix your program.
Breaking the code into manageable chunks is a huge part in writing clear, maintainable software. A high amount of curly braces implies deep nested loops and/or branches, which also implies a high complexity (measured by cyclomatic complexity).Also, IDEs can auto insert braces and indent the code. Unless you're using notepad, I don't see the problem.
git clone --depth=1 git@github.com:git/git.git
find git -name '*.c' -type f | xargs grep -P '^( {4}|\t){4}' | wc -l
11375
git clone --depth=1 git@github.com:torvalds/linux.git
find linux -name '*.c' -type f | xargs grep -P '^( {4}|\t){4}' | wc -l
732937
Stupid shitty broken software. </s>"$ find git -name .c -type f | xargs fgrep '{' | wc -l"
19288
"$ find linux -name
.c -type f | xargs fgrep '{' | wc -l"1408368
It's not as if Torvalds wrote the entire codebase by himself, anyway.
Everything should be made as simple as possible, but not simpler.
Sounds like node and its moronic packaging ecosystem.
What I would like would be a way to portably create a stack frame and pass it around as an object and then call a function with it.