× 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.



Joe Pluta and I agree yet again.  

Once a program breaks into 200 lines of C specs or more you have begun to
build in complexity that is not needed and is expensive to maintain.  At 500
or more lines a program has become a potential maintenance magnet.  
 
 
 
---------------------------------------------------------
Booth Martin   http://www.MartinVT.com
Booth@xxxxxxxxxxxx
---------------------------------------------------------
 
-------Original Message-------
 
From: RPG programming on the AS400 / iSeries
Date: Tuesday, August 05, 2003 4:09:40 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Adoption of new RPG techniques
 
> From: Seth.D.Shields@xxxxxxxx
> </Joe Pluto wrote>
 
Seth, how about getting the name right <grin>.
 
Pluto is either a planet or a Disney character.
 
Anyway...
 
 
> With all due respect Joe, I don't think I have ever written a five
line
> program with one if/endif. Most programs are much, much
> larger than that and include embedded DOs, IFs, SELECT/WHENs, FORs,
etc.
> As far as I am concerned, free format makes a huge
> difference in readability and maintainability. I would define that as
> revolutionary.
 
If you're converting a 500-line mainline into /free, I contend that
you're actually abusing the syntax. Using procedures to break the code
into readable fragments is far more revolutionary than indenting a long
monolithic chunk of procedural code, and procedures were introduced with
fixed format RPG IV.
 
The code fragment I showed is a procedure. The idea behind procedures
is to allow you to write five-line pieces of code. In fact, most
programming texts I read say that a procedure shouldn't span more than a
page, and you shouldn't go more than two levels of nesting. And in that
environment, indenting is a lot less of an issue.
 
Three- and four-level nested code should be reviewed for possible
refactoring. Five-level code should be sanity checked. Six-level and
above needs to be rewritten in MI <smile>.
 
Joe

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.