On Thu, 23 Apr 2009 20:32:30 +0000, Ted MacNEIL wrote:
>
>I find the weak programmers are the ones to use strange (and often 
>misunderstood) tricks, or as we used to call it 'spaghetti code'.
>
What's a "trick"?  What's an "idiom"?  In a recent discussion in
TSO-REXX, Phil Smith, among others, urged that programmers understand
the idioms of whatever language.  I strongly agree; perhaps I go
beyond his notion of idiom.  A programmer fluent in other languages,
and naive in HLASM might code IC ... STC in a loop and consider
BCTR ... EX ... MVC a "trick".

Or, how about (Rexx):

    if X<>Y
        then call foo ( 1 )
        else call foo ( 0 )
/* versus: */
    call foo ( x<>y )
/* ?       */

(Superfluous parentheses added for benefit of "weak programmers".)
I unashamedly do the latter.  Anyone who complains should simply
read "The Rexx Programming Language".

Or:

    IF TRANSACTION_AMOUNT <> 0.00
        THEN MASTER_TOTAL = MASTER_TOTAL + TRANSACTION_AMOUNT

(This is a literal transcription of a specification that
an imaginary accountant versed in desk calculator processes
might have given a programmer:  "Why bother adding zero?")

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to