in reply to OT (funny) How to write unmaintainable code

Of Perl:

22. Avoid {}
: Never put in any { } surrounding your if/else blocks unless they are syntactically obligatory.
If you have a deeply nested mixture of if/else statements and blocks, especially with misleading
indentation, you can trip up even an expert maintenance programmer. For best results with
this technique, use Perl. You can pepper the code with additional ifs after the statements,
to amazing effect.

...

Perl Only
: Use trailing if's and unless's especially at the end of really long lines.
B^D
  • Comment on Re: OT (funny) How to write unmaintainable code

Replies are listed 'Best First'.
Re^2: OT (funny) How to write unmaintainable code
by Jenda (Abbot) on Aug 22, 2006 at 23:45 UTC

    Except that the "advice" 22. is not applicable to Perl since the {}s are always obligatory for if()s. The if statement modifier is a completely different beast. Though code like this:

    foo( 1, 2, s/sdfgdgI&^%#GG*&T$#/WRUGSkyug/) if ($x == 5);{ $gotcha->('dude'); ... }
    could cause some misunderstanding ;-)