Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Welcome to the Monastery
 
PerlMonks  

Re^3: Perl ternary operator style

by SimonClinch (Chaplain)
on May 30, 2011 at 12:08 UTC ( #907307=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^3: Perl ternary operator style
Re^4: Perl ternary operator style
by BrowserUk (Pope) on May 30, 2011 at 12:29 UTC
    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

        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.

        If you (now) take the time to double-check the OP, then from the second code block alone, it is very plain to see that function1() == function2() is not a "special case", but the only case.

        And if you read the OPs text, is is even more clear.

        So, first you only read 1/4 of the post; 2) you misinterpret it; 3) you assume that all the other respondents have misread it and rubbish their replies; 5) you ignore a polite suggestion to double check your interpretation and come back with a shitty response; 6) you post this meaningless drivel.

        And you think I need to "get real".


        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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-04-25 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (585 votes), past polls