In RPG III: Good for Its Time (MC, April 1999) and IBM Cares More than You May Think (MC, September 1999), Senior Technical Editor Ted Holt argues that RPG IV is superior to RPG III (a.k.a. RPG/400) for application development. I disagree.
I started out with RPG and welcomed RPG II and then RPG III as big improvements. The new instructions added to RPG III, such as CAT, CHECK, ITER, LEAVE, SCAN, SELEC, and SUBST, were great enhancements to the language. However, when RPG IV came on the scene, I felt that the many complications heavily outweighed the few improvements. One of the major reasons RPG III is better than RPG IV is that it is simpler.
The most important thing in programming is the application, not the language. Usually, the simpler the language, the better the accuracy and maintainability. A complicated language such as RPG IV should be used only if it will result in a big bottom- line gain for the organization by increasing both productivity and accuracy. RPG IVs complex features, such as ILE binding and activation groups, just arent necessary for most AS/400 shops. Built-in functions, procedural prototypes, and subprocedures may result in financial benefit for a few shops, but only if they have an extremely talented and disciplined staff that can not only learn to use the complicated language but also restrain themselves from wasting time and showing off by using complicated methods when simple methods would better serve the purpose. Simplicity is really the key. Let me give you a few examples.
The fixed columns of RPG III (vs. RPG IVs free-format columns) allow a maintenance programmer to easily scan positions 18, 28, 33, 43, 54, and so forth.
Each letter in a field name is important, and RPG IIIs enforced uppercase saves a programmer from struggling to differentiate between the lowercase letter l and the number
1. However, RPG III does allow mixed case for comments, enhancing their readability. In RPG III, the comments on calculation specification are in positions 60 through 72, so they can be seen on 80-column screens when using SEU. In RPG IV, however, they are in positions 81 through 100. Of course, the programmer could scroll right or use a larger display screen. But what if a maintenance programmer doesnt do either and misses something the original programmer meant him to see? Again, this could affect productivity and accuracy.
The EVAL instruction in RPG IV seems like a good idea (i.e., it puts all the calcs for one item in one statement), but my COBOL programming experience tells me that too
many embedded parentheses can lead to entanglement and inaccuracy (as well as maintenance programming nightmares). Also, is it so bad to use several statements to calculate one item?
Furthermore, RPG III has a better interactive source debugger (ISDB), which can affect productivity and, therefore, the bottom line.
In theory, RPG IV could pay off big in productivity gains if you have staff who can make the most of it. For example, IBM did a project at The New York Times with the S/38 when it first came out. Through the use of reusable modules, the project got done about 10 times faster than normal. However, most AS/400 shops dont develop modules, document them, and then enforce their use.
I wonder how many shops are actually using RPG IV. Some arent even on an operating system release that allows it. However, of greater interest might be how many shops could use RPG IV but have chosen to use RPG III instead.
Sometimes, IBM does listen to its customers. Perhaps if enough of us let IBM know that we prefer RPG III, it would occasionally make sensible improvements to it, such as indicatorless programming and the overlay feature for data structure definition.
Ill close with an analogy. When the U.S. Air Force goes into combat, it relies on the 50-year-old B-52 bomber (which it plans to use until the year 2045). The new B-1 and B-2 bombers have many maintenance problems, and their occasional use seems to only be for show. Does it seem to you that RPG III is the old, simple, trusty B-52, while RPG IV can be likened to the new, complex, unreliable B-1 and B-2?
LATEST COMMENTS
MC Press Online