Long ago, in a galaxy far far away there was a language called Algol. It had various incantations, one of which was called "Algol 60" (I use that reference since I am a bit familiar with it). In Algol 60, you only had ONE way to do it.
... a := if b then c else d;
Was a very acceptable construct. A few years later when the R of K & R was designing his language called "C", he liked this construct, but didn't like all the typing, and invented "Mr. Ternary". He already had control constructs from other languages (Mrs. IfElse) because they were very common. To combine the two into one wasn't his "style". So we were given two different constructs, one to use in control flow, and another one to use in expressions.

Now along comes Mr. Wall and he desires to have something that will fit his acronym for the language he is calling Perl. That begat "eval" to make expressions out of control structures. So, we can now do everything any which way we desire to make wonderful artwork out of programs that are cryptic to all.

Now comes our modern friend and he desires to keep his job (for whatever reason) and wants to do either of two things:

1) Be as cryptic as possible so he will be "indispensable" guaranteeing full employment.

2) Document all his code and make it as easy to read so he can be promoted to manager to earn more $$$.

One can do almost anything more than one way. Typically one will be "better" for the given circumstances. You will need to decide which is which. It is up to you.


In reply to Re: Mr. Ternary is greater than Mrs. If Else by herby1620
in thread Mr. Ternary is greater than Mrs. If Else by PerlPhi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.