|
> 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. It's no harder "to get it wrong" with fixed format code than with free form. Other than indenting, there's no difference between the languages, except for those that the RPG team has artificially contrived. In fact, according to your later statement, it's actually EASIER to hide bad code in fixed format than in free format. > 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. Uh, Hans? For some RPG coders, it IS a new concept. Duh. But "formatting code" is a lot more than indenting. There are multiple schools of thought on nearly every decision in the process, from number of spaces to where to hang your end opcodes. > 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. This is one man's opinion, and ignores the hard stuff, including how to properly break multi-line statements, handling selects, and a number of other topics. > 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! Hey Hans! Flip! Flop! Flip! Flop! Earlier you said it's easier to code properly in fixed format! Now you say it's easier to code bad code in fixed format! Hey, maybe IT'S JUST EASIER TO CODE IN FIXED FORMAT! Wow, what a novel concept! Actually, the truth is that choice is personal, like choosing an IDE, and comparing the two on any sort of absolute basis is just bombast. Poor code lives in any syntax. As an example, one of the poorest coding techniques ever devised can only be accomplished in C and its derivatives: the misuse of the "for" construct as a generic looping mechanism. But your implication here is that somehow programmers stick to fixed format to hide bad code. I suggest you correct that perception, Hans, unless you wish to cultivate a reputation as an elitist. > 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. :-( There is no debate, Hans. Some people simply prefer fixed format. They have as much right to their opinion as you do to yours. But frankly, many of us have been slower in the uptake of free format than we would have otherwise because you decided to remove the MOVE opcode. Because there is no MOVE, there is no clean way to mechanically translate to entirely free format code, as there was from RPG III to RPG IV. This single act of ... what? Arrogance? Misguided elitism? Whatever the reasoning, that decision has slowed down the uptake of /free more than perhaps any other single thing. So when you want to blame someone for the lack of acceptance of /free, look in the mirror. Joe
As an Amazon Associate we earn from qualifying purchases.
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.