Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Style, *again*

by Abigail-II (Bishop)
on Apr 10, 2003 at 19:42 UTC ( #249722=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Style, *again*
in thread Style, *again*

I see.

I do sometimes write the constant first, because I want to reduce the amount of punctuation. If you write:

foo $x, $y == 4

then foo isn't called with arguments $x and $y. You'd need to write that as:

foo ($x, $y) == 4

Or

4 == foo $x, $y

And since == is a symmetric operation (assuming it's not overloaded), I don't feel strongly for the "topic first" argument. But I can see your point.

Abigail

Replies are listed 'Best First'.
Re: Re: Style, *again*
by demerphq (Chancellor) on Aug 18, 2003 at 18:28 UTC

    And since == is a symmetric operation

    Which is the reason I often put the constant first. Turning an == into an = accidentally results in a non symmetric operation which is illegal when the left side is a constant. Which helps catch silly mistakes that the compiler doesnt notice (like in the conditional part of a ternary op.)


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://249722]
help
Chatterbox?
[atcroft]: james28909: Make both hands into fists, place them together (with thumbs concealed), and every knuckle is a month (starting with Jan.) has 31 days, every dip (between knuckles) does not....
[atcroft]: (And Feb. is the odd case, because it is 28, unless it is a year divisible by 4, or if it is divisible by both 100 and 400 (at which point it is 29).)
[james28909]: i know but scroll through your calendar on your computer.
[james28909]: i thiught you were going to say make both hands into a fist and puch yourself in the face
[atcroft]: .oO(Sorry, I probably should have said take two normal hands....)
[atcroft]: james28909: No, unless you are a politician, I wouldn't say that (and even if you are, I still probably wouldn't say that).
[james28909]: i mean how hard can it be? its just subtracting days lol
[atcroft]: james28909: What about October 5, 1582?
[stevieb]: atcroft: "Make both hands into fists..."... is something my Ma taught me in our native lang, but I was to ignorant and young to pay attention. Thanks for that :)
[atcroft]: stevieb: Sad to say that I only recently learned that particular trick, but I have since found it very useful.... :)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2017-04-29 04:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.