Re: Cobol work?
- From: Joe Zitzelberger <joe_zitzelberger@xxxxxxxxxx>
- Date: Thu, 03 Nov 2005 03:40:27 -0500
In article <TTN8f.16242$_31.8441@xxxxxxxxxxxxxxxxxxxxxx>,
"Judson McClendon" <judmc@xxxxxxxxxxxxx> wrote:
> "Joe Zitzelberger" <joe_zitzelberger@xxxxxxxxxx> wrote:
> >
> > It is very common to find programs where EVERY declared variable is
> > prefixed by "WS-". The effect of such tautologies is only to reduce the
> > namespace, and thus the possible meaningfulness, by three characters.
> >
> > But my personal pet peeve is the idea that some people have that a
> > number provides some form of uniqueness. A common example, using
> > paragraph names:
> >
> > 1000-READ-FILE.
> > 2000-READ-FILE.
> >
> > Often the defenders of such crap will staunchly oppose the clear and
> > meaningful approach of:
> >
> > READ-MASTER-FILE.
> > READ-TRANSACTION-FILE.
> >
> > There was once a (somewhat) useful purpose behind both of these. The
> > data name prefix did help locate variables when you got your compile
> > listing back after your deck was submitted. And the numeric prefix on
> > the labels helped maintain order when the only control structure
> > available was the GO TO. But that was a long time ago.
> >
> > Cobol culture and standard practices do anything but encourage
> > meaningful names, the encourage some level of meaninglessness in support
> > of conventions that have had no practical purpose for 30 years or so.
>
> I believe you have a limited view, my friend. :-) The reasons above are not
> the only ones for those conventions. I do agree that preceding *every*
> WORKING STORAGE data item with "WS-" is nutty.
>
> The convention today is to break applications down into very small programs,
> but sometimes there are practical reasons of system architecture that make
> fewer, larger programs desirable. In an online program that handles 30 or 50
> different screens, it makes perfect sense to prefix every paragraph that
> handles screen 12, for example, with 12nnnn-, and place '12' in the prefix
> of every WORKING STORAGE data item for that screen. In such a program there
> may be quite a number of READ-MASTER-FILE paragraphs, all very similar,
> though likely not identical, and the '12nnnn-' type of paragraph prefix
> identifies them perfectly. And if you have 5000 lines of DATA DIVISION,
> prefix of 'WS-' meaning a 77 level can be very useful. Sure, you can find
> any data item quickly with your source editor, but why do even that, if the
> name can tell what you need to know? This is so simple and powerful, I am
> amazed that it isn't very obvious to you.
If any program handles 30 to 50 screens it has completely missed the
concept of modular software.
In my mere 27 years of software construction I have never found a case
where it was desirable to have fewer, larger, programs. (I will not say
that I haven't written such, but it was never desirable) Such
monolithic beasts violate every principle of of modern software
engineering.
> I sometimes build systems with hundreds of thousands, even millions, of
> lines of code and many files. In such a system, I create name and
> abbreviation dictionaries so that every word used in data/paragraph names is
> spelled or abbreviated in *exactly* the same way in every use. Data names
> for the same field never vary, except for a prefix that designates the
> record (or "WS-" for 77 levels) containing the field, or when the sense of
> the field changes (e.g. Current Balance -> Previous Balance). My systems are
> crafted as carefully as I can build them. Nothing is left to chance that I
> can prevent, and I go to great lengths to make them understandable and
> maintainable. In my whole career (since '68) have never once delivered a
> system that a client was less than very happy with, and typically, after
> three or four weeks eliminating the few final bugs, I don't hear from the
> clients for months or years, until they want something new. Two weeks ago I
> fixed a bug in one of my systems that another programmer put there, and
> that's the first bug in a deployed system I've fixed for over a year, and
> that one was by the same programmer. If you have programming methods that
> produce better results than this archaic, out-of-date methodology that I
> use, then please tell me about them. :-)
I do indeed have programming methods that produce more stable, easier to
maintain code: Modular programming and Object oriented thought
processes. Both will help to insulate you from haphazard maintenance
programmers -- even in non-OO languages.
Not only is a nice, clean, OO implementation blindingly obvious for a
maintenance programmer to understand, but the limited scope of
everything tends to protects it from even those that don't get it.
> Just because the reason for something isn't obvious to you, doesn't mean
> there isn't a reason, even a good one. The real world is messy and chaotic.
> Programming real-world applications so that they are clear and
> understandable takes hard work, discipline, and careful adherence to
> practical methodology, things we see too little of these days. :-)
I specifically complained about the ubiquitous use of "WS-" for
everything not in a copybook -- a common shop and textbook standard BTW.
I know that you make meaningful use of prefixes, so do I. I was
complaining about silly conventions that avoid meaningful use as you
describe it above and require a single, universal, prefix to be used
everywhere.
If there is some other reason for universal WS- prefixing other than
grouping your fields in the compile listing XREF it certainly is not
obvious to me. I am curious to know what it is.
.
- Follow-Ups:
- Re: Cobol work?
- From: Judson McClendon
- Re: Cobol work?
- From:
- Re: Cobol work?
- Prev by Date: Unicode fonts
- Next by Date: Re: Cobol work?
- Previous by thread: Re: Cobol work?
- Next by thread: Re: Cobol work?
- Index(es):
Relevant Pages
|