Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: OT (funny) How to write unmaintainable code

by explorer (Chaplain)
on Aug 22, 2006 at 18:37 UTC ( [id://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.
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 ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://568945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found