Hello Programmers

April 30, 2010 | By greg | Posted in RPG Intro

This FREE site is dedicated to all professional programmers trying to write clear structured code, network their pc's and, in some cases, deal with web site issues.

We have free source code, free samples, free tips and techniques, free utilities, free sample test questions and answers, free downloads, free books and manuals, free examples.

You do not have to "register" or anything else to see it. Enjoy.


SQL is a nonprocedural or "set oriented" language and HTML is a Markup Language, but T-SQL and PL/SQL are procedural extensions to SQL, making it like Java, C/C++, PHP, RPG, Perl, VBA, and etc.

There is a lot of information on the internet about C and C++ and Java, JavaScript, and HTML etc.. But, not for RPG programmers (those who work on IBM's AS/400 = iSeries), there just isn't much at all.

It is hard to find free RPG utilities, code, tips, and tutorials. Most everything comes with a price tag - and RPG info. is more expensive than most others. We have found a few free sources and have shared the best of them here.

A reality in the computer business is that things have been changing faster than in almost any other market -- and it is unfortunate that when IBM realized they would have to make the AS/400 communicate easily with the internet (or continue to loose business at an even more alarming rate) their infamous response to all the RPG programmers out there was a double page ad suggesting that RPG programmers could get jobs flipping burgers. The AS/400 was then and now being sold as "a Java Machine".



IBM RPG ILE hamburgers - or - JAVA

By, or soon after, the year 2000, jobs for RPG programmers had virtually disappeared in the US. (ex: about 2 RPG jobs vs. the more than a dozen RPG jobs constantly here in south Florida; now, 2010, there has been maybe 1 every few months in the past few years)

For those still working in RPG it becomes ever more difficult to find information. What we have and can find, we offer to you freely here (see categories of topics on the side).

[ Alternately, get a domain name, and pay the $10 a month for a web site you can build and experiment with yourself (see PHP and MySQL topics). web-page-hosting-review.com and web-hosting-reviews.org and 100best-domain-names.com are good sources for comparisons and recomendations. -Greg ]

On our Links page, we are not trying to list as many sites as possible, like some others we have seen, but only the best, most comprehensive, sites and, where there is a small site with somthing of value, we try to specify exactly what it is. If we can make the list useful to us, it could be good for you also. If you know of a great site that we have not yet found, please leave a comment.

In RPG, especially, unstructured code, with its goto's, exits, jumps, and etc., has been a tangled web of "spagetti", taking twice as long to figure out, modify or enhance and, the larger the program grows, the more often it is modified, the more disastrous it becomes.

Software vendors and IT departments alike, know the all too real limitations of continually updating and enhancing their programs. The ability of a co. to survive may be affected by the professionalism of their programmers. or of their vendor's IT depts. Good structured, simple, code can keep IT costs down and prevent lost time that can cost it market share, even profitability. . . The fewer the lines of code, the better.

"The most basic practice, for those programming in procedural languages, is to avoid the infamous goto statement well structured and designed programs simply have little need for it. "Spaghetti code," riddled with gotos, is notoriously difficult to decipher."
- 1 programmer's affirmation

THE 3 BASIC PROGRAMMING CONSTRUCTS
1. SEQUENCE consecutive
2. BRANCH if - else
3. LOOP do while
The basics of structured programming:
All code stays within the 3 constructs, therefore

  1. there are no goto's, jumps, exits, iterates, etc.
  2. all loops terminate at the bottom.
    (the condition may be expressed at the top)
  3. there are no infinite loops.

The Sequence is the in-line "execute one line after another" code between loops and branches.
A branch is an if "do something" (else, "do another").
A loop is just a sequence that is repeated while some condition is true. ( or for a given count, etc. ) All too often programmers get lazy and don't think of the consequences. They insert some kind of "if X then exit", failing to see that they have just put one more nail in the coffin of a dying program which, if it is only one of many, could lead to the replacement of all the software and maybe hardware. If that happens, the programmers could soon be gone also, if not the whole company.

Consider that no one cares what won't happen. and 3 lines saying what won't happen is ever more a waste when 2 lines could have said, clearly, what will:
like

     if not [OK]
        exit, jump, iterate, goto, ... spagetti, spagetti;
     end if
     { your code (???) }

instead, the clear and more concise (2 lines) structured alternative:

    if [OK]
       { your code }
    end if

Wow, so much clearer and Obvious!

More notes from others:

"It's frequently necessary to thoroughly understand all the details of long-forgotten code. I've often had the challenge of trying to decipher another person's application - and I've also had the humbling experience of trying to understand code that I wrote years ago. ...
"I now believe that if it takes more than a moment to understand a code segment, either more documentation is in order or the program structure should be revised. If I have to get back into this code five years from now, I'll want to know exactly what everything does, and why - and I'll want to know it fast!
"All variable, constant, function, and source file names should be succinct and descriptive, and accurately reflect the purpose of the variable. Even the lowly loop index needs to be more than just "i", "j", "k", etc." Also, imagine your anger if "i" is all you have to go on for finding a loop somewhere in a large program.
[As cryptic as "ii" or "jj" or "kk" is, at least you can find it. -Greg]

Finally, source code benefits from peer review. You may only need to clarify a few comments and make variable names more descriptive, but when a second pair of eyes finds fundamental implementation flaws at an early - and inexpensive - stage of development, the extra process is worth it.

Leave a Reply

Website url (required)

Comment / Question