Seymour, don't you find once you start coding that the way you thought the
program was going to work won't do after all?  I do, frequently.

---
Bob Bridges, [email protected], cell 336 382-7313

/* There is no snooze button on a cat who wants breakfast.  -anonymous */

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of
Seymour J Metz
Sent: Wednesday, June 16, 2021 11:10

I wasn't referring to comments, although the reasons for writing prefatory
comments before the code are clear, but to external documentation. Not so
much at the beginning, but once I had TSO FORMAT as an alternative to ATS,
and even more so once I had SCRIPT, I would do user documentation first,
then module comments, and finally code.

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of
Jeremy Nicoll [[email protected]]
Sent: Wednesday, June 16, 2021 7:25 AM

Likewise; I document what the parameters to routines will be and what will
be returned for both normal calls and errors.  I illustrate them with what I
think would be sample values & the corresponding results.

Later on, when I write code, I usually use the same samples (or parts of
them) in the comments, showing how the code manipulates the values.

In any block of code that does something complicated I will start off with a
comment block describing the problem, the approach I'm taking, the data
structures I'm using (& sometimes why I chose those and what else I
considered) and describe how that code would act on particular inputs etc.
Then in the code I try to comment showing the likely contents of variables
for (if there's space) several sample values - typically two boundary
conditions and a middle-of-the-range value.

--- On Wed, 16 Jun 2021, at 09:23, Seymour J Metz wrote:
> I developed the habit of writing documentation first, and changing the 
> documentation before changing the code. It has served me well.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to