× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I had an instructor in college who faulted a FORTRAN program I had
turned in. I had already been doing FORTRAN programming and needed
the class. The program was simplistic beyond belief. Did a single
calculation and printed the result.

My line of code was:
GROSS = HOURS * RATE

His complaint was that a comment was needed there. In the example
above, a general series of comments was in place to describe what the
program was to do.

Point being that, IMO, comments should describe >what< is intended by
a sequence and explain any odd segments, without just repeating the
code. Seeing something bizarre like the old trick of multiplying a
number by the magic RPG number (which I have forgotten) to change the
order of digits in a numeric representation of a date DOES need a
comment (but that particular multiplication technique is likely best
avoided in the first place.

John McKee

On Mon, Mar 26, 2012 at 9:56 AM, Charles Wilt <charles.wilt@xxxxxxxxx> wrote:
Comments lie...

Trust but verify...

Charles

On Mon, Mar 26, 2012 at 10:35 AM, Jerry C. Adams <midrange@xxxxxxxx> wrote:
I can't say that I disagree.  However, I have seen the opposite problem;
i.e., the program logic changes, but the documentation isn't changed.  More
than once I have tried to make sense of a program in which I could see that
it was doing one thing, but the documentation said something different.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.