Ian Hulin <ianhuli...@gmail.com> writes: > I'm not asking for a grand re-write on this, but for single-exit to be > the preferred style for new code and patches where this would not > provoke changes on a GCR (Grand Code Re-write) scale.
I disagree. Structured exits decrease the level of nesting and contortion and make code more straightforward to follow. if (!precondition) { return 0; } // Do the real work, 200+ lines of code, 5 levels of nesting return zappa (whatever); is much much more cleaner to follow than zappadap result; if (precondition) { // Do the real work, 200+ lines of code, 5 levels of nesting result = zappa (whatever); } else { result = 0; } return result; Get the trivial cases out of the way, completely, first. That way, you don't need to keep yellow tabs on braces to track even the trivial code. Write and read code like a man! Juggling a dozen open ends at once is the special skillset of childraisers, not programmers. And if you do both at once, you'll be glad you don't need to track large contexts even for the trivial tasks, when you have a spare minute for programming. -- David Kastrup _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel