For Programmers: Free Programming Magazines  


Home > Archive > Cobol > July 2004 > Re: Linugistics & COBOL design









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Linugistics & COBOL design
LX-i

2004-07-20, 8:55 pm

james8049 wrote:

> FLAMEBAIT


Okay, I'll bite. ;)

> Badly written if statements can be totaly ambiguous.


You can say that about any language. I've seen an If that took some
time to dissect, but I've never seen one that, upon close examination,
couldn't be discerned. :)

> A western reader's brain is hard wired to process periods in "firmware"
> - you simply do not "see" them, which is why nearly every language since
> has picked the semi-colon or something equaly big and obviuous as a
> statement terminator.


There is a style of coding where the usage of periods is greatly
reduced. (Of course, that leads to what my English teacher would call a
"run-on sentence", but the compiler doesn't seem to care...)

> A sentence with lots of long words does not make good reading in
> English, and, a convulted Perform or Inspect with 30 character
> qualified field names make some COBOL programs harder to read then the
> small print in an insurance contract.


I agree that qualification sucks. I understand its usefulness in
certain situations, but it does lead to longer-than-necessary code
throughout the program, just to be able to say "move corr a-group to
b-group".

However, I was also taught that variable names such as "x", "y", "c",
"n", etc., were to be eschewed in favor of more meaningful names. I've
got to say that, in my maintenance experience, I agree with this
whole-heartedly. I shudder when I think about the program that had a
3-D table, and six variables named "sub", "sub-2", "sub-3", "sub-4",
"sub-5", and "sub-6". It took execution analysis just to figure out
what that spaghetti was doing! (I was also under a severe time-crunch,
and I had never worked on the program before.)

Meaningful names are a must. I've found that by dropping the dashes and
using mixed case, COBOL's 30 characters are usually enough to make
something meaningful. :)

(I'll own up to using "x" as a loop counter only in tightly-defined
loops, where the inside of the loop is only a few lines. But, if I'm in
a larger loop, it's "charIdx" or "customerTableEntry" or something like
that.)


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ LXi0007@Netscape.net ~
~ _____ / \ | ~ http://www.knology.net/~mopsmom/daniel ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ I do not read e-mail at the above address ~
~ Please see website if you wish to contact me privately ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com