Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Perl ternary operator style

by holli (Abbot)
on May 30, 2011 at 09:30 UTC ( [id://907290]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl ternary operator style
in thread Perl ternary operator style

Well, before calling other people misreader you better double check that it's not you who has actually misread.


holli

You can lead your users to water, but alas, you cannot drown them.

Replies are listed 'Best First'.
Re^3: Perl ternary operator style
by anonymized user 468275 (Curate) on May 30, 2011 at 12:08 UTC
    So what in my post suggested that I didn't double check?

    Anyway, you were warned about it and even then, by inference, managed to misread the beginning of the OP! Who is it that has to double check? Try counting the number of function calls in the first code block of the OP.

    One world, one people

      ry counting the number of function calls in the first code block of the OP.

      You're right there are two function calls. But they are both called Function(), not Function1() and Function2() as in your example.

      Whirrr-click-whirrr. Yes. That's right. The OP is calling the same function twice!.

      And if you looked just a few lines further down, he acknowledges in his second code sample where he tries to avoid that:

      $Target = ($temp = Function($params)) ? $temp : $DefaultValue;

      It's one thing to misread a post, we've all done that. But to fail to double check when it is suggested you should; and then claim you already did; and then respond with such .... (I'll let you fill in the rest.)

      Nice one. I bet you're a Jackass fan aren't you.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        I saw that it was the same function call - doh - but since the OP was giving it as an example of style as opposed to a specific code snippet, I considered that the general case of function1 and function2 was absolutely required in my response - function1 = function2 is a special case that doesn't affect the question of best syntax. On the other hand labelling them 1 and 2 is clearer.

        OK so one could say you checked the text of the OP, but surely it is reasonable to raise a theory of style to a reasonable level of abstraction and I am surprised you don't even see that that is what I wad doing. You really think adding 1 and 2 to the function names was a misread on my part? get real!

        One world, one people

          A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-29 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found