Conversation
Notices
-
Embed this notice
Wouter Verhelst (wouter@pleroma.debian.social)'s status on Sunday, 22-Oct-2023 23:52:49 JST Wouter Verhelst Cuddling elses or not?
Damien Conway's "perl best practices" recommends not to, because it would reduce visibility of the else block.
I vehemently disagree. Having an else block start on a line by itself makes it look like an unrelated statement, when in reality it is a continuation of the if block.
By cuddling your elses, you make it more clear that the block is part of a larger set of other blocks (if/elsif/else), rather than it being a block on its own.- clacke likes this.