in reply to bloated 'if' formatting
should be rewritten asif ( A && B && C ) { }
Even better would be using some set of useful objects that provide a useful interface for you.if ( is_AB( @stuff ) && is_C( @stuff ) ) { } sub is_AB { my @stuff = @_; return A && B; } sub is_C { my @stuff = @_; return C;
Before anyone replies, please note that I'm saying "Decompose better and design with interfaces in mind." In other words, having read PBP, I'm agreeing with Damian's statements on the process of design. Not enough coders actually spend the 15 minutes to think through how the various pieces of their code are going to interact and then spend another 15 minutes diagramming out the separation of concerns. Long conditionals are a very smelly way of finding out that you don't understand the process you're attempting to have a computer do for you.
|
|---|