You don't know how lucky you are.

Andy Jewell andy at wild-flower.co.uk
Mon May 12 18:02:03 EDT 2003


My head is now full of cryptic, raggedy, uppercase, rambling RPG/400.

 * Light-hearted troll about RPG vs. Python
C			TROLL BEGSR
I'm back from my reincarnation ceremony as a fully fledged neophyte RPG 
programmer, and i've just had my customary 'baptism of fire'.

Not until you have to delve into the guts of the archaic art of languages such 
as RPG do you *fully* realise the inherent beauty of Python (or Perl, for 
that matter!).

The phrase 'line noise' doesn't do justice to the chaotic jumble that is a 
'mature' RPG program, combining the worst of old and new(er) coding 
standards.  

Here are a few examples of why RPG is just so infuriating for me:

1) Short identifier names: max 6 characters, all uppercase.

2) Array names have to be shorter still, as, if you want to put values into 
them (!), you have to index them (wow!), but the index bit is (sort-of) part 
of the array name, e.g. 

C                     MOVEL'TEST'    ARRY,I

! The 'result' field is only 6 characters long, so a the name of an array has 
to include a comma and the index variable, you're stuck with names < 4 chars!

3) 'Indentation' is not allowed.  Actually, everything has to be in a specific 
column, according to what you're trying to do...

4) No modules, functions or procedures.  You have to make do with passing 
parameters in global variables.

5) There are *only* global variables.

6) No algebraic expressions: you gotta break your equations down into their 
component parts, i.e.

	a=pi*R^2

becomes:

C	R		MULT R         T1
C	T1		MULT PI        A	100
	
(The columns aren't *right* but you get the idea.  The 'operations' always 
line up)

7) Indicators, "the poor man's exception".

8) F, E, I, O and C - specs.  Every line must start with a 'specification 
character' in column 6, except comments which start with an asterisk in 
column 7, and 'compile time array data' which starts right after the last 
executable statement in the program, at column 1.  Lines with the same spec 
type are grouped and must appear in a certain order.

9) Non-executable opcodes, which can go anywhere in the C-specs.  Other parts 
of your program may reference them, but may have to spend time trawling round 
for them.  The compiler doesn't care where you put them (in the C-specs).

10) Low-level types; BCD numbers and strings only.  Ok, there are arrays and 
data structures, but they're cumbersome.

Looks like I'll *never* be a proper Heretic - I just like Python TOO MUCH!

11) I just coded (in my lunch-time) what it took me two days to write in RPG, 
using Python/400.  Will test it tomorrow, just to prove to myself how much 
FASTER RPG runs :-)

 * End of TROLL routine
C			ENDSR


the failed heretic

PYTHON IS THE ONE TRUE PATH ;-)

-andyj





More information about the Python-list mailing list