in reply to Conditional initialization of my-variables
Your example has reinforced my long-held support for Use block if not postfix if (as recommended in Perl Best Practices).
Though a bit longer, I've always found block if to be clearer and easier to understand. The big win comes during code review whenever you want to add an extra statement to the if condition -- that's a simple one line change to a block if, compared to a more violent restructuring of the code from postfix if to block if.
See also the first principle from Re: Big cache (my top ten software development practices):
and my longer Coding Standards Links.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Conditional initialization of my-variables
by Bod (Parson) on Apr 07, 2023 at 19:26 UTC | |
by eyepopslikeamosquito (Archbishop) on Apr 07, 2023 at 23:32 UTC | |
by LanX (Saint) on Apr 08, 2023 at 12:57 UTC | |
by LanX (Saint) on Apr 07, 2023 at 19:40 UTC | |
by Bod (Parson) on Apr 08, 2023 at 17:55 UTC | |
by LanX (Saint) on Apr 08, 2023 at 18:24 UTC | |
by kcott (Archbishop) on Apr 08, 2023 at 19:49 UTC |