If you need more than 3 levels of indentation, you're screwed anyway, and should fix your program.
About this quote
- What does it mean?
- Code requiring many indentation levels is usually too complex and needs restructuring.
- In plain terms
- If your code is nested too deeply, rewrite it.
- What can you take from it?
- Keep code flat and simple to avoid complexity.
Where it applies
Putting it to work
Questions to consider
- When is nesting acceptable?
Another view
Some contexts legitimately require nested logic.
More from Linus Torvalds
Your job is being a professor and researcher: That's one hell of a good excuse for some of the brain-damages of Minix.
Permalink to quote #7 You know you're brilliant, but maybe you'd like to understand what you did 2 weeks from now.
Permalink to quote #9 Do you pine for the days when men were men and wrote their own device drivers?
Permalink to quote #6
Related quotes
I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad …
Linus TorvaldsLinus Torvalds quote #49 Though I'll admit readability suffers slightly...
Larry WallLarry Wall quote #25 Man is the animal that draws lines which he himself then stumbles over. In the whole pattern of civilization there have been two tendencies, one toward straigh…
Piet HeinPiet Hein quote #1