Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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.
B^D


Comment on Re: OT (funny) How to write unmaintainable code
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
Node Status?
node history
Node Type: note [id://568945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2014-08-28 07:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (257 votes), past polls