Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Conditional style (if, &&) query

by bjohnso (Sexton)
on Oct 17, 2001 at 02:46 UTC ( [id://119277]=note: print w/replies, xml ) Need Help??


in reply to Conditional style (if, &&) query

I've been accused of writing VERY C looking perl code. But once you get in to a programming style, I've noticed it's pretty tough to change.

I personally find it a LOT easier reading the traditional C style if statements. They just make code look SO much cleaner and easier to follow.

My other gripe is comments. The more comments the better. I personally hate coming back to my code after 6 months and having to remember what assumptions I made when I wrote it.

So I guess my vote is for:
if (expr) { b(); }

Replies are listed 'Best First'.
Re (tilly) 2: Conditional style (if, &&) query
by tilly (Archbishop) on Oct 17, 2001 at 04:17 UTC
    The more comments the better?

    I strongly think not, and that is a gripe of mine.

    Don't get me wrong. I use comments, and on the whole I have quite a few of them. But to me comments are something which has to be done right or else it is worse than useless, and I would prefer to see completely uncommented code to overly verbosely commented code.

    For a thread that outlines my personal commenting style and the reasons for it at some length, I would suggest reading Re (tilly) 2 (disagree): Another commenting question,. (Note that behind the scenes we traded a series of /msgs that were more friendly than the discussion there.) After reading that, if you think that I really need more comments than I use, or that my points about how comments can be a problem are off-target, please give me feedback.

Re: Re: Conditional style (if, &&) query
by Biker (Priest) on Oct 17, 2001 at 15:36 UTC

    I beg to disagree with the statement "The more comments the better.".
    Personally I state and restate:
    "Any programmer of the language in question is supposed to understand what the code does."
    "OTOH, you must document why the code does it."

    This is especially important when the code makes assumption about the behaviour of external libraries or when the code depends on (more or less documented) side effects.

    f--k the world!!!!
    /dev/world has reached maximal mount count, check forced.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found