Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Is It Time for Free-Format?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Is It Time for Free-Format?

    Hassan.Farooqi wrote: We have to sell management that investing in "Maintainable" or "Readable" code is cost-justified. I personally find columnar code to be extremely readable. There have been occasions where I was able to justify complete rewrites. They are few and far between. In one case it was was for an order entry program. Order Entry is often one of the largest programs in any shop, and has a thousand business rules to follow. I was able to show that the existing set of programs not only did not follow the rules, but were counter-productive. Rewrites may also be justified in the case where huge unnecessary programs mire down a system. (e.g.) Non AS/400 people may design a system without the knowledge of the wide variety of native menus. I have seen this repeatedly throughout the years, and I have encountered complicated obstacles to simple cures. I have won a few battles, lost a few, and resolved some through diplomacy and compromise. I agree with Ralph. Rewrites for the sake of rewrites are inefficient, costly, and accomplish little if anything at all. There has to be an underlying business reason. Dave

    Comment


    • #17
      Is It Time for Free-Format?

      I already did a "/free Jon Paris" shirt a year ago when the U.S. Immigration and Customs Department, rightly so, wouldn't let him in the Country. I took his photo from the RPG World website and inserted the slogon over top hish shoulders.

      Comment


      • #18
        Is It Time for Free-Format?

        David wrote: "I personally find columnar code to be extremely readable." I've written programs in dozens of programming languages. I worked daily with RPG for almost all of 23 years. But after all that time, I still never really got used to reading "columnar code". Fact is, indentation has been considered an element of good programming style for at least the past 40 years. At least one programming language actually requires consistent indentation! Indentation is considered such an obviously vital part of good programming style that very little research has been done on the subject. But one paper, entitled "Program Indentation and Comprehensability", describes one study. In the conclusion, the authors wrote: "No indentation produced significantly lower mean scores and the subjects found working with this program difficult. We conclude that in a large program, no indentation would be a real hindrance and very difficult to use." I'm not sure if I'd go so far as to recommend that existing code be rewritten in a free-form style. However, there's no excuse for not writing new code using /FREE. Cheers! Hans

        Comment


        • #19
          Is It Time for Free-Format?

          Hans.Boldt wrote: Fact is, indentation has been considered an element of good programming style for at least the past 40 years Yes, and I indent with the purest of heart when I code in COBOL. Yet I find myself far more productive using RPG. Dave

          Comment


          • #20
            Is It Time for Free-Format?

            Did You ever tried to read and maintain a CL Program 3000 lines long? You would get confused where starts the DO and where it ends ENDDO. On the other hand with RPG I could easily match up IF-ENDIF by column. I also wrote a utility that puts a number in position 5 to show how deep is the level of IF/ENDIF DO/ENDDO. Also in position 50 I could see where the variable is being changed. For this reason I am trying to avoid the EVAL operation. any way the EVAL operation that has the advantage to do many arithmetic operations in one shot, is hard to debug afterwards. I am using EVAL for string manipulations, because the fixed format version is much more complex and does not have all options. Of course You could write a FREE program with Indentations that would look nice, but it is not automatically. If we are talking about having some utilitys which would automatically indent the code, than we should debate about the utilitys not the language. Since this is a debate about the language, the fixed format is just easier to maintain and more standardized. In free format you could write more than one operation on a line, which should not be done. Of course, You could use self discipline not to do it, but since the language allows it, there is no way to prevent it from some programmers using it, and then the code is very hard to maintain by another programmer.

            Comment


            • #21
              Is It Time for Free-Format?

              Hi Bob, I have completely moved to free-format programming and really enjoying it. One flaw I think, can't we do away with the /free and the /end-free starting on column 7and 8, rather have it inserted anywhere on the line and why waste column 1. Thereafter all coding should still be valid from column 1. Whats the reason for this? Otherwise free-format is here to stay.

              Comment


              • #22
                Is It Time for Free-Format?

                AVROHOM wrote: "Also in position 50 I could see where the variable is being changed." The outline function in WDSC will tell you the same thing much quicker. "Of course You could write a FREE program with Indentations that would look nice, but it is not automatically." WDSC does automatically indent the nested code. And if you don't like how it does it, you can change the number of spaces it indents. I've heard these arguments before in my shop with programmers whom did not see the need to move forward. My favorite was "Just use the logic cycle, you don't even have to read the file". I can happily say that all 10 programmers in my shop use /free. We did not mandate /free to them. We simply introduced the syntax and I offered a couple of classes to guide them and they embraced it. All of them did not embrace subprocedures over subroutines, but they are slowly migrating.

                Comment


                • #23
                  Is It Time for Free-Format?

                  Are you saying that it's never appropriate to use the cycle? Thanks. Tom.

                  Comment


                  • #24
                    Is It Time for Free-Format?

                    Honestly, I have never found a situation in the past 6 years where it was necessary. I have yet to hear one explanation of why it should be used for new development (and yes I have had developers under my supervision try to make the argument). Sure, we maintain it when we have to, but usually if time permits, we will rewrite it.

                    Comment


                    • #25
                      Is It Time for Free-Format?

                      Given that I've never used it (except for one weekend early on in the only time I was on a /38, where they specified it for a report) and rarely have modified a cycle program, and that's for 17 years now, I'm certainly not one to be able to do comparisons, but it's beyond my comprehension that this could still be considered the basis for business programs which serve business users well. rd

                      Comment


                      • #26
                        Is It Time for Free-Format?

                        RPG was Report Program Generator. A language meant for Accounts Clerk to produce reports without having to code a lot, especially loops etc. Just like Fortran (Formula Translation) a forumula like language, was for scientists and COBOL (Common Business Oriented Language) and English like language was for Business Managers etc. As RPG grew, people wanted to code more and moe like other languages and hence got rid of the cycle. People like me want to write a code that Business Analyst and Managers (with some programming language knowledge but no RPG knowledge) can read. We first got rid of the cycle, and we want to get rid of fixed format ... in its entirity! Other than this, RPG cycle is a very efficient way of programming and should be used by people like Bob who don't have problem with fixed format.

                        Comment


                        • #27
                          Is It Time for Free-Format?

                          Hassan: There's nothing incompatible between the cycle and /FREE. The cycle is one of the things that differentiates RPG from other languages. If you want to ignore the cycle completely, there's less reason to choose RPG over other languages, IMO. (Actually, Perl has a read cycle too, but much more limited. Look up Perl options -n and -p.) Since the cycle is well suited to transaction based processing, it could potentially be used in a SOA environment. Cheers! Hans

                          Comment


                          • #28
                            Is It Time for Free-Format?

                            brianmay wrote: > Honestly, I have never found a situation in the past 6 years where it was necessary. I have yet to hear one explanation of why it should be used for new development (and yes I have had developers under my supervision try to make the argument). Sure, we maintain it when we have to, but usually if time permits, we will rewrite it. A lot of things aren't 'necessary' but very useful. This discussion has occurred more than once on midrange.com with zealots on both sides. Having cut my teeth on RPG about 30 years ago I know the cycle well. If you need to write a report with control breaks, subtotals, etc etc etc, and already know the cycle, I cannot fathom why one would not use it. It makes things such a breeze. Would it be worth learning for that purpose if one didn't already know it? IMO, yes, but to each his/her own. And don't use the argument that one shouldn't use it because 'no other language has it'. (Then why have an i5 with a database built in? Other machines don't have a database built in.) That argument just leads to a lowest common denominator kind of usage. IMHO. -- Jeff Crosby Dilgard Frozen Foods, Inc. P.O. Box 13369 Ft. Wayne, IN 46868-3369 260-422-7531 The opinions expressed are my own and not necessarily the opinion of my company. Unless I say so.

                            Comment


                            • #29
                              Is It Time for Free-Format?

                              There's nothing wrong with using the cycle... with procedures... and /free. And for perverse pleasures MR. LOL Tom D. (ok - maybe MR is pushing it a bit)

                              Comment


                              • #30
                                Is It Time for Free-Format?

                                We are moving to /free on new programming for the same reason we are incorporating sql into RPG. We are a manufacturing firm using RPG. We are getting demands for WEB development-for order entry, graphing existing reports, and whatever else our users can think of. We have started hiring experts in these areas and most of them are not familiar with RPG. When they have to look at our code, it makes more sense to them in /free and sql. Also, every 4 years or so, when it's time for the big system upgrade, we fight the battle of keeping the AS400 versus another way. I shudder to think. I love programming RPG in any of it's forms, but another benefit is the experiencing of coding differently in case we make that transition. One of the benefits of Bob's article for us was helping to devise some standards.

                                Comment

                                Working...
                                X