James,
I think Larry used EXACTLY the right term to describe the RPG cycle. Please don't yell at me for disagree with you, but the very nature of the cycle is to rely on an implied process. With 0 lines of code (well, ok, one line of code; Fspec) to describe the developer's intent, what else would one call it.
The advantage of avoiding the cycle is that ANY developer worth his or her salt can review the code and have a clear understanding of the program's intended function. The cycle IS powerful, and has been used successfully by many shops for many years, but it is hardly intuitive. Plunk any young developer down in front of a cycle based RPG program, then tell them that they must first read and understand chapters 3, 4, and 5 of the ILE RPG reference before they can understand what the program is doing.... Not very productive... Give them the same program, written with full-procedural file handling structures, and they can see instantly how the program flows.
JMO,
Eric
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of James Lampert
Sent: Friday, December 14, 2007 11:44 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Multi- Occurrence Data Structure
Larry Ducie wrote:
I contest the idea that putting explicit do-loops for explicit file reads
adds unnecessary complexity to a program. On the contrary, I believe it
removes the obfuscation that the cycle introduces.
Obfuscation? What obfuscation?
Since one MUST either use, short-circuit, or disable The Cycle in any
RPG program, anybody who has any business programming in RPG is going to
be aware of it (otherwise, his or her programs, if they compile at all,
are going to go into endless loops). Therefore, the first three things
anybody should look for in an unfamiliar RPG source member are:
1. Is there a primary file? If so, then the program is implicitly "do
this for every record in the file."
2. Where (if anywhere) is LR being explicitly set on, and under what
circumstances?
3. Where (if anywhere) is there an explicit return, and under what
circumstances?
As an Amazon Associate we earn from qualifying purchases.