[Fluff] REXX Programming for DBAs: a Rant

Nick CIANCI

[Fluff] REXX Programming for DBAs: a Rant
Speaking of which ... there was a magazine article in one of the
IBM-flavoured publications very late 80's or in the 90's entitled
"Assembler guru - small "G" !" or something like that. Had me rolling
doubled up with laughter on the floor.

Has anyone seen / have a soft copy of the article. It mentions some PFY
("author") going up to a crusty MVS SysProg for documentation on an
assembler routine and being told it was "self-documenting"! Sort of thing
Raymond would keep, although I'm not 100% sure he's old enough?

Anyway Phil & Faz:

i=1 ; pt = 'brother' /* */
cs = 'speaking to the converted'
while j=j do
say cs pt
pt = '!' /* */
if i <> 1 then break ; else ; i=0
end

I know what you mean!

Regards,
Nick CIANCI





"Fazio, Richard"
<[login to unmask email]
N.COM> To
Sent by: DB2 Data [login to unmask email]
Base Discussion cc
List
<[login to unmask email] Subject
ORG> Re: [DB2-L] [z/OS] REXX Programming
for DBAs: a Rant

08/01/09 03:38 PM


Please respond to
DB2 Database
Discussion list
at IDUG
<[login to unmask email]
2-l.org>






Phil,

I’m right there with you…just having a bit of fun.

I detest sloppy, poorly written code. I think we should all be on a quest
to accept only the highest quality code. There’s no excuse for poor doc or
no doc.

Coders in the 60’s and 70’s were highly technical and true
pioneers…privileged few whom were given resources to create software.
The 80s brought a glut of programmers into the fray with more resources
than knowledge and a “let’s just try it” approach to coding.
The 90s bring us the instant gratification of the web and real 4GL
programming. Self describing, self-documenting programming. A promise
that has just started to come to fruition (AbInitio and Data Stage are
pushing massive data volumes efficiently and graphically).

Methodology, SDLC, whatever you call it has moved us out of the cowboy wild
west of the 80’s. Structure, discipline and procedure should prevent crap
from being promoted beyond POC status.

We need to keep our expectations high and our tolerance for crap way way
low.

By the way…crappy database design counts too. Who knows…maybe this DB2
Thang will catch on.

Keep up the faith!
faz


From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Sevetson, Phil
Sent: Wednesday, January 07, 2009 3:48 PM
To: [login to unmask email]
Subject: Re: [DB2-L] [z/OS] REXX Programming for DBAs: a Rant

Rich,

Actually, I’ve seen unstructured code in a bunch of languages. I’ve
just been working with REXX and SQL and JCL almost exclusively for
the past year and a bit. I certainly didn’t mean to imply that REXX
is the only place to find badly structured code.

I’ve been careful to name no names, and frankly don’t want to know
who wrote the code I’m maintaining at the moment (conversion from
DB2V8 to DB2V9, the code parses the results of DISPLAY THREAD and
issues CANCEL THREADs in certain circumstances). Paul Fegan, in a
different post above, issued an example of good structured code (a
little differently than the way I write, but that’s code for you). I
don’t think _everybody_ writes badly structured or unstructured code,
and for a twenty-line-or-so piece of work even I have done it. But
there’s a depressing amount of stuff that _is_ bad and _isn’t_ only
one page long, out there.

I’m not on a “jihad” to improve code generally, though it’d be nice
to see good quality, of course. Just letting out some frustration to
a bunch of friends – you all – who have no doubt had similar
experiences.

--Phil


From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Fazio, Richard
Sent: Wednesday, January 07, 2009 4:04 PM
To: [login to unmask email]
Subject: Re: [DB2-L] [z/OS] REXX Programming for DBAs: a Rant

Phil,

Hmm let me think about this….

<Return rant >
So, you’ve never seen unstructured Cobol code? Unstructured
Assembler? Unstructured C, C++, Fortran, EasyTrieve Plus…take your
pick.

I can right crappy code in any language (it’s a gift).

I have written several Rexx execs that exceed 1000 lines. Each of
these EXECs I’m pretty proud of and published to this very community.
As such, the code is beautiful, well structured, well documented
(300-500 lines of comments in each exec)….heck, I even lined up the
IF statements throughout the whole exec.

Regarding messages, I not only put out descriptive messages, I also
have my own Messages and Codes reference that I use consistently
across ALL the Rexx code that I publish: Say "RFMI0010 - IGNORING
UNRECOGNIZED KEYWORD: "KEY_WORD

As a programmer (or at least used to be) I always want people to see
my BEST work!

That all said, do I write little hacks that perform wild and crazy
things with little or no doc…probably, but if it’s something complex,
you bet I put in doc and always use a structured style by default.
Not for anyone else but FOR ME. Who knows when I’ll need that little
snippet of code and with my memory…I NEED THE NOTES :- )

So, the question is not “why do ‘these people’ write bad code”…the
question should be “why to ‘these people’ ALLOW themselves to be
caught writing bad code!”

The “art” of programming is not getting caught presenting a poor
piece of code by others.

Don’t lump all Rexx programmers in one bunch. I would venture to say
that due to the extremely “change and go” nature of any dynamic
scripting language you will see this same loose style of programming.
Take a walk on the Unix side. Sed, awk, korn, pearl….now thar’s some
hacks! It will make non-structured Rexx code look pretty darn nice.

</Return rant>

On second thought…never mind. : - P
faz


From: DB2 Data Base Discussion List
[mailto:[login to unmask email] On Behalf Of Sevetson, Phil
Sent: Wednesday, January 07, 2009 10:18 AM
To: [login to unmask email]
Subject: [DB2-L] [z/OS] REXX Programming for DBAs: a Rant

I have been a DBA now some three times longer than I was a
programmer. None the less, programmer habits persist for me.

In the late 1970’s, if you were learning COBOL, it was assumed
that you would learn it in a Structured Programming style. The
Structured paradigm was top-down design driven, sometimes “GO
TO”-less, and assumed the use of only three command structures:
sequential execution, iteration, and branching. The preferred
style of programming was to use “loosely coupled” modules,
where you passed to a subroutine (or a paragraph) the
information that it needed, it performed its operation, and
returned control to the calling module (usually by an EXIT
statement in an otherwise empty paragraph, or by the end of a
paragraph). This form of design has become more firmly defined
over the succeeding years with such structures as
parameter-driven Database Stored Procedures, which don’t care
where they’re called from and return control to the calling
routine at the end of the procedure.

Except, apparently, for REXX programming.

This is not the fault of the REXX designers. They have
provided for transfer of control points (comparable to COBOL
Paragraphs) with statement labels and the PROCEDURE and RETURN
statements. They have provided for commenting in industry
standard ways.

So why, whenever I look at a REXX program in any given
environment, doesn’t ANYBODY do structured programming with it?
The whole industry is full of what we used to call spaghetti
code, with statements uncommented, unlabeled, executing in
sequence with no explanation; full of indexes named “I” and “J”
and so forth; the only good thing I see about the code I’ve
inspected and modified at four different companies where I’ve
been involved in the process is that everyone uses CALL instead
of SIGNAL.

People, the code I’ve read looks like crap. Where is the pride
in workmanship? Where is the concern for the next person to
look at this stuff?

Put a label at the beginning of a group of related statements,
such as reading an input record and checking for valid data,
and a RETURN at the end of it, and put a number on the label
indicating its relative position in the program. Such as:
0100-ALLOCATE-FILES. Or 1000-CONTROL-LOGIC. Or
1600-DEFINE-SYSTABLES-CURSOR, and 1700-FETCH-SYSTABLES-CURSOR.
Use PROCEDURE and EXPOSE. Use extensive comments and put them
in asterisk boxes or hyphen boxes. Get a book on structured
programming and read the basics. PLEASE.

Okay, rant over. We now return you to your regular technical
forum.

--Phil Sevetson, NYCAPS DBA Support
Financial Information Services Agency of The City of New York
450 West 33rd Street, 4th Floor
New York, NY 10001
phone: (212) 857-1688
mailto: [login to unmask email]


=========
Confidentiality Notice: This e-mail communication, and any
attachments, contains confidential and privileged information for the
exclusive use of the recipient(s) named above. If you are not an
intended recipient, or the employee or agent responsible to deliver
it to an intended recipient, you are hereby notified that you have
received this communication in error and that any review, disclosure,
dissemination, distribution or copying of it or its contents is
prohibited. If you have received this communication in error, please
notify me immediately by replying to this message and delete this
communication from your computer. Thank you.

Any opinions, expressed or implied, presented are solely those of the
author and do not necessarily represent the opinions of the agency or
the City.
=========






IDUG 2009 - North America * May 11-15 * Denver, Colorado, USA


IDUG.org was recently updated requiring members to use a new password. You
should have gotten an e-mail with the temporary password assigned to your
account. Please log in and update your member profile. If you are not
already an IDUG.org member, please register here.






IDUG 2009 - North America * May 11-15 * Denver, Colorado, USA


IDUG.org was recently updated requiring members to use a new password. You
should have gotten an e-mail with the temporary password assigned to your
account. Please log in and update your member profile. If you are not
already an IDUG.org member, please register here.






IDUG 2009 - North America * May 11-15 * Denver, Colorado, USA


IDUG.org was recently updated requiring members to use a new password. You
should have gotten an e-mail with the temporary password assigned to your
account. Please log in and update your member profile. If you are not
already an IDUG.org member, please register here.






IDUG 2009 - Australasia * 18-20 March * Melbourne, Australia


IDUG.org was recently updated requiring members to use a new password. You
should have gotten an e-mail with the temporary password assigned to your
account. Please log in and update your member profile. If you are not
already an IDUG.org member, please register here.

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Raymond Bell

Re: [Fluff] REXX Programming for DBAs: a Rant
(in response to Nick CIANCI)
You flatter to deceive, my friend. You know I'm as old as the hills - well, as old as The Doors' 'Light My Fire'. No relation, BTW. We were both released 29 years ago last Christmas, in a manner of counting...

And no, I don't have a copy - of either the single or the article. Sorry. I'm sure someone around Canberra/AU1 will have one. And I just noticed your e-mail address change. If you're no longer one of Jerry's friends you know what your new middle name is now, don't you?

Wow, does this count as my 2nd too-early-for-Friday post? That's me done for the week, then.

Laters, innit?


Raymond

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf Of Nick Cianci
Sent: 08 January 2009 05:11
To: [login to unmask email]
Subject: Re: [DB2-L] [Fluff] REXX Programming for DBAs: a Rant

Speaking of which ... there was a magazine article in one of the
IBM-flavoured publications very late 80's or in the 90's entitled
"Assembler guru - small "G" !" or something like that. Had me rolling
doubled up with laughter on the floor.

Has anyone seen / have a soft copy of the article. It mentions some PFY
("author") going up to a crusty MVS SysProg for documentation on an
assembler routine and being told it was "self-documenting"! Sort of thing
Raymond would keep, although I'm not 100% sure he's old enough?

Anyway Phil & Faz:

i=1 ; pt = 'brother' /* */
cs = 'speaking to the converted'
while j=j do
say cs pt
pt = '!' /* */
if i <> 1 then break ; else ; i=0
end

I know what you mean!

Regards,
Nick CIANCI

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html