Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: if statement confusion

by blackstarr (Pilgrim)
on Jun 12, 2012 at 07:00 UTC ( #975699=note: print w/ replies, xml ) Need Help??


in reply to Re^2: if statement confusion
in thread if statement confusion

You make a very valid point, but I think you carry the logic too far.

Yes, I'd always want an expert to be the one handling my contracts, medical diagnosis, etc. But does that mean that they should be made as complex as possible so that ONLY an expert can understand it?

I'm sure that there are a lot of very good coders out there who can look at a bit of compact code they wrote 2 years ago and see it's purpose and complexities at a glance, however most of us humble mortals need time to figure these things out ... and for us clearly written easily maintainable code is far more important than shaving a femosecond off a CPU operation.

Hats off to you gurus ... we all want to end up like you ... but we're not there yet, so please don't discourage us by insisting that only compact, complex code is acceptable.

So Long
blackstarr


Comment on Re^3: if statement confusion
Re^4: if statement confusion
by stevieb (Chaplain) on Jun 12, 2012 at 08:10 UTC

    I am curious to know who exactly you're responding to here.

    The ternary operator is not overly advanced at all. Any Perl programmer who is even low-mid level advanced (at minimum) can see it in a heartbeat. If you haven't seen it before, it may often be seen multi-line like this:

    $ans = 6 < 8 ? 'true' : 'false';

    ..or even like this:

    $ans = ( 6 < 8 ) ? 'true' : 'false';

    for precedence sake (as shown in the man page). Going off as you have is ridiculous. You say "there are a lot of very good coders out there who can look at a bit of compact code they wrote 2 (sic) years ago and see it's (sic) purpose and complexities at a glance" and then you say "however most of us humble mortals need time to figure these things out...".

    First, I am but a humble mortal, and I don't even consider myself a good coder, but I sure can remember this type of snippet with no question. Not only that, but I'm willing to bet that any one of my 'humble mortal' monks who have been around even as long as I have would know what this type of *idiom* looks like.

    I don't normally call someone out like this, but wow, who are you trying to defend, and more importantly... do you realize who you're putting down?

    ps. If you want something more simplistic, ask for it. If you *know* there is something more simplistic, why are you complaining... seems to me that if you know in advance, you must know for yourself.

    what are you looking for... this?

    if (a){ b; } else { c; }
Re^4: if statement confusion
by stevieb (Chaplain) on Jun 12, 2012 at 08:28 UTC

    I just went through every one of your past posts, and it appears to me as though you're just a 10 year old sock fscking puppet that has 20 posts you decided to dredge up.

    Not ONE of your past posts as this person has any code whatsoever, so why would you decide to dig up an old alias to attack?

    Making yourself look worse homie.

      Err ... why the aggression?

      My apologies if I've offended you, but as my comment wasn't even directed at you I don't see why you should get insulting about it.

      1.) I only have this one handle ... If I wanted to stay unknown I'd post as anonymonk

      2.) I wasn't commenting on the actual code at all ... I'd never presume to do that because I KNOW I'm not good enough.

      3.) I wasn't attacking anyone, I wasn't being sarcastic, I was stating an honest opinion ... or do I have to be vroom before I am allowed that?

      4.) My comment was 100% aimed at the BrowserUK's idea that there is no need for easily readable and maintainable code, it had nothing to do with the actual code under discussion. It also had nothing to do with any personal opinion of BrowerUK and his abilities as a coder ... I've read enough of his posts to know he's way better at perl than I'll ever be. My difference is purely philosophical, not personal.

      So Long
      blackstarr
Re^4: if statement confusion
by BrowserUk (Pope) on Jun 12, 2012 at 10:48 UTC
    Yes, I'd always want an expert to be the one handling my contracts, medical diagnosis, etc. But does that mean that they should be made as complex as possible so that ONLY an expert can understand it?

    No. But then, I never suggested that. Requiring more than "a glance" is not the same as "complex as possible".

    And suggesting that every program should be written so as to be understandable by the most inexpert of programmers is a crock.

    Eg. There are some algorithms that are very cleanly and concisely described using recursion, that require verbose, intricate and vastly more complex descriptions when done without it.

    But there are quite a few "programmers" -- including some I've encountered in quite senior positions with 'many years of experience' -- who simply cannot 'get' recursion. Avoiding recusion because there are some people that will never get it is ridiculous.

    Finally, there is nothing "complex" or "difficult" about the ternary statement:

    my $var = cond ? constantA : constantB;
    , which is where this subthread got started.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    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.

    The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://975699]
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-12-28 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (181 votes), past polls