A Bit of my Philosophy

Philosophy is such a pretentious word. Perhaps I should call it my way of thinking about programming.

If I am not programming for my own use, I want to do what the user wants and needs. Of course, sometimes the user does not really know what he wants, and I must help him try to figure it out. But I do not take the attitude that I know better than him what is good for him.

As for technique, I try to be like the physician- at least do no harm. I try to be careful and not introduce careless errors. And I desk check as much as I can. The earlier you catch errors in the process, the better.

But perhaps I should get to areas where I might differ from a great number of other RPG programmers. In RPG, due to language evolution, there are often many ways of doing the same thing. Unless doing so will only perpetuate and intensify confusion, I prefer to maintain a program using code in the style it is written. That is not a hard and fast rule, but a general principle. If it is in RPGIII style, it will usually continue to be so, even if I have migrated it to RPGIV. I might enhance it with code unique to RPGIV, but I will not often consider it my duty to go beyond my maintenance function, rip the program apart and rewrite it.

My consideration of coding choices revolves about effectiveness. I will use whatever will create smooth, elegant code, whether it is considered new, or “old” and “archaic”. If an “old” technique works better, I will use it rather than some solution cobbled together from “new” techniques. If the new one is better, I will use it. It is all about what works most elegantly and clearly. Terseness is not the only goal. The time it takes to key in a program is the least time-consuming part of programming. If terseness, the keying of the fewest characters on the keyboard, were the goal, I would have given up RPG long ago and learned APL.

Too often I feel, programmers think that “change is good”, so they feel the urge to update old code, even if it is working without error at present. Programmers also seem to be easily swayed by what is the newest fashion in programming. I am not. To condemn a programming technique as being not “modern” is the grossest form of condescension. Remember, Adolf Hitler was at one time the “newest” ruler of Germany, was a popular choice, and represented vast “change” in the political landscape. That “change” was not good for Germany or the world. On a less cosmic level, change in programming technique is not necessarily good. An opcode is not good merely because it is a part of a set of new opcodes or BIFs (built-in functions). Each one must withstand inspection to make sure it is worth using in any given situation.

And sometimes we seem to forget that any RPG installation that existed before the advent of RPGIV is going to have “old-styled” code; the older the shop, the older the code. It is pointless to try to hide this fact from new RPG programmers; it is useless and self-defeating to try to hide this code from the new programmer or let him believe it does not exist. Unless you are part of a software company and have free rein to make any changes you please, you will be maintaining old code at some point.

How these principles apply in my coding technique will be made more clear as we go on this blog. There may be other ideas that also come into play. For now let the above suffice.

Leave a Reply