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



Lim Hock-Chai wrote:
Like I mentioned before, depending on who you talk to, some will say free-form is the greatest thing that happen to RPG but other will say it is the most convoluted RPG coding he/she ever seen.

I think what make RPG successful is because it provides an easy way to access database (chain, read, setll..) not because it is simple. I still remember the first time I encountered a RPG cycle program, confusing, confusing.

Hopefully you are using RPG IV already. If you are, do you really want to go back to RPGIII?




I think most programmers understand what free-form coding is all about. At least, I think that's true for anyone who's ever coded in any other programming language. (Apart from RPG, I know of only one other programming language that had a strict columnar format. But I'm not aware of anyone who uses GPSS anymore. (Coincidentally, GPSS came out of IBM at roughly the same time as RPG!))

But some programmers who try free-form probably should stick to fixed-form. Or at least until they see more properly written free-form code. Free-form code that's not properly indented looks pretty bad. The problem is that with freedom comes additional responsibilities. With a fixed-form system, there's only one way to code, and so it's hard to get it wrong. With free-form coding (as is the case with practically every other programming language out there), you have to apply some discipline to ensure your code is readable. As I said, this isn't a problem if you're used to coding in another language and you already know how to format code. But unfortunately, it seems to be a new concept for some number of RPG coders.

For those who need some guidelines, the most important thing about free-form coding is consistent indenting:
1) Start at column 8, and for each new nesting level, indent 3 characters. That is, the code within a IF, DOW, DOU, or subroutine block should be indented 3 characters in from the IF, DOW, DOU, or BEGSR statement.
2) The ENDxx statement should be indented the same amount as the corresponding IF, DOW, DOU, etc.
3) Comments should be indented at the same level as code.


Another issue may well be that proper indentation of free-form code may well magnify and emphasize a design structure that's poor to begin with. It's easy to hide a poor code structure in a "straight-line" fixed coding style!

Personally, though, it just boggles my mind that so many RPG programmers have such a strong attachment to the old fixed-form style. Sometimes this debate reminds me of the following quote: "If you've been pounding nails with your forehead for years, it may feel strange the first time somebody hands you a hammer. But that doesn't mean that you should strap the hammer to a headband just to give your skull that old familiar jolt." --Wayne Throop. It would appear that some RPG programmers still prefer using their forehead. :-(

Cheers! Hans


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.