Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: OT (funny) How to write unmaintainable code

by explorer (Chaplain)
on Aug 22, 2006 at 18:37 UTC ( #568945=note: print w/replies, xml ) Need Help??

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.
  • 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 ;-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://568945]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2018-01-18 13:46 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (211 votes). Check out past polls.