9 ms·
The broad suggestion that indentation is somehow wrong is ill-advised. Sure, various of the refactorings given are sensible. But the basic problem is not inden
by hxa7241 14y ago
The broad suggestion that indentation is somehow wrong is ill-advised.
Sure, various of the refactorings given are sensible. But the basic problem is not indentation. If something can be simplified, simplify it. If something is too long, break it into pieces. But if something is tree-structured, that is what it is, and it probably ought not be bent out of shape.
(Note: Fowler's refactoring 'Replace Nested Conditional with Guard Clauses' is very specific -- it does not declare that all nesting is bad.)
A tree-like-indentation structure is a perfectly good element of programming -- why try/want to change it into something else?
In fact, a good case could be made that software in its most fundamental essential conception is tree-structured -- even that engineering generally is tree-structured.