Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Mr. Ternary is greater than Mrs. If Else

by herby1620 (Monk)
on May 21, 2007 at 20:55 UTC ( [id://616643]=note: print w/replies, xml ) Need Help??


in reply to Mr. Ternary is greater than Mrs. If Else

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found