If you need more than 3 levels of indentation, you're screwed?
- by jokoon
Per the Linux kernel coding style document:
The answer to that is that if you need
more than 3 levels of indentation,
you're screwed anyway, and should fix
your program.
What can I deduct from this quote? On top of the fact that too long methods are hard to maintain, are they hard or impossible to optimize for the compiler?
I don't really understand if this quote encourages better coding practice or is really a mathematical / algorithmic sort of truth.
I also read in some C++ optimizing guide that dividing up a program into more function improves its design is a common thing taught at school, but it should be not done too much, since it can turn into a lot of JMP calls (even if the compiler can inline some methods by itself).