|
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of john e
Sent: Thursday, July 03, 2008 5:46 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Standards question: What is your feeling
about%found&%eofvs.%found(file) & %eof(file) ?
I don't think this is purely style, like indenting two or four spaces.
It's about a quite important principle and that is "don't repeat
yourself". Problem is, it seems to contradict with the principle of
explicit vs implicit. It's almost always better to be explicit instead of
implicit. But in this case, its better to prevail the DRY principle over
the explicit one, because actually you were explicit in mentioning the
filename in the chain/read opcode. Although in another statement. But if
that statement is the previous one then you could see the two (chain; if
%found;) simply as one in which you mention the filename only once.
Date: Wed, 2 Jul 2008 15:27:01 -0500%found&%eofvs.%found(file) & %eof(file) ?
From: joepluta@xxxxxxxxxxxxxxxxx
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Standards question: What is your feeling about
(Which
Lim Hock-Chai wrote:
When I see,
Read myFile
Dow not %eof()
My mind immediately knows that you are trying to loop thru myFile
listtranslates to clearer for me).Okay, I understand your point, and frankly I think it's perfectly valid
- for you. This is a perfect example of why I try to stay out of
programming style arguments; it is ultimately impossible to find the One
True Style.
Unless you qualify your initial premise with "in my opinion", style
statements are very hard to defend. There are often several equally
valid ways of doing the same thing. The problem comes when you try
telling someone else that their way is "wrong". That's when you start
hearing things like "readability" and "self-definition" and
"maintainability". As nice of concepts as all those things are, they
are often mutually exclusive. This is a perfect case; even though it
can be reasnonably argued that an unqualified %eof is easier to
maintain, it fails on the pure self-definition attribute. And so if you
insist on using some external yardstick to justify your decisions - and
more importantly to try to force others to agree with you - then you
usually end up painted into a syntactical corner.
Rather than trying to tell someone else how to code, it's far more
important for you to come up with a consistent, logical set of standards
for your shop. Then take the time you would spend trying to convince
people on mailing lists and instead use it to document your standards
for the newcomers; they'll benefit more from it than someone who is
likely to never agree with anyway.
Just my .02
Joe
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
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.
_________________________________________________________________
De leukste online filmpjes vind je op MSN Video!
http://video.msn.com/video.aspx?mkt=nl-nl
--
This is the RPG programming on the AS400 / iSeries (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 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.