ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

What is strong point of RPG programming language?

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

  • What is strong point of RPG programming language?

    Dear all,
    I have worked with RPG III programming language many time,
    I have question, but can not find out the really correct answer.
    Please help me to give your idea about this question.
    Why we have to use RPG to code while RPG is very difficult?
    What is strong point of RPG programming language?

    How about your idea about this question?

    Thanks for your help,
    Best regards,

  • #2
    Re: What is strong point of RPG programming language?

    I would say that the strongest point of RPG is database access. DB2 on the AS400 and the RPG language are all tightly integrated which makes it quick and easy to get file access up and running.

    Ironically I would say that it is also one of it's weaknesses. I've never seen a language influence database design so much as RPG. This is particularly the case with green screen applications.

    One example might be a comment file being made up of comment lines with a line number as part of the key. This is obviously designed for a green screen application where the comment is displayed in a fixed format over several lines. This can then be a pain in the butt when you modernise and start using free format text areas in a web front end.

    There are other issues to do with the buffers and changing files. Programmers are inherently lazy, it is one of the three great virtues of a programmer. Unfortunately this leads to fields and even whole files being re-used for other purposes rather than have to re-compile a whole bunch of programs. In an SQL world you tend to avoid "SELECT * FROM" so you only update the fields you're interested in.

    Secondary I would say is the ease of calling C and Java programs from an RPG program. RPG itself is very limited in some respects but at least when you do come unstuck it's not too bad to write a component in another language and get them talking together. In theory you can even step in debug from an RPG line to a called C or Java line. I've done this with C but never managed to get it to work stepping into Java.

    Being a native language it performs very well at the things it does. If you want to write something that does a lot of processing and file I/O it's not a bad language to pick. I think it is very suited to something like a billing and rating engine.

    As for RPG III this is a legacy language now and should only really be used for working with legacy applications. So the strong point of RPG III is that you can change existing code already written this way without having to re-write everything. I can't think of any reason why you would choose to write something new in RPG III. It would be like writing a new Java program with an old version 1 compiler. You wouldn't do it.
    Ben

    Comment


    • #3
      Re: What is strong point of RPG programming language?

      RPG III? why not join this decade? RPG IV (especially utilizing the ILE environment) is frigging light years better/faster/stronger (can't resist the Six Million Dollar Man reference) than RPG III. RPG IV is still continually being enhanced/improved whereas RPG III is static, no more new features, etc.

      In some cases I agree with Ben but it don't see tight integration with the database as a weakness at all. if you wish to "escape" the integration you can abandon all of it by using embedded SQL (which i highly recommend you use the right tool for the job, sometimes SQL is a better fit, most times not).
      I'm not anti-social, I just don't like people -Tommy Holden

      Comment


      • #4
        Re: What is strong point of RPG programming language?

        I'll try and re-phrase a bit. Personally I see tight integration with the database as a strength of RPG. However, this comes with high coupling between the database and the software. This is not so good.

        As for using the best tool for the job, I think a lot of people just use the tool they know best.
        Ben

        Comment


        • #5
          Re: What is strong point of RPG programming language?

          Originally posted by BenThurley View Post
          As for using the best tool for the job, I think a lot of people just use the tool they know best.
          Which I'm guilty of myself on occasions.
          Ben

          Comment


          • #6
            Re: What is strong point of RPG programming language?

            Originally posted by bienvu View Post
            Dear all,

            Why we have to use RPG to code while RPG is very difficult?

            If you believe RPG is very difficult, then programming probably isn't the right job for you. I'm not sure what language you can compare it to that is easier.
            Michael Catalani
            IS Director, eCommerce & Web Development
            Acceptance Insurance Corporation
            www.AcceptanceInsurance.com
            www.ProvatoSys.com

            Comment


            • #7
              Re: What is strong point of RPG programming language?

              I've programmed to varying degrees in a number of languages including VB6, VB.net, C#, PHP, Java, C and JavaScript as well as the usual AS400 suspects like CL and RPG.

              I would say that they're all difficult in their own little ways. That's why programmers are paid favourable wages! Out of all of those I would say that only C was as hard as RPG. Java has the potential to be difficult, particularly if you're used to the procedural paradigm. However, I was lucky that I learnt this as my first language at uni so have no problem thinking in objects.
              Ben

              Comment


              • #8
                Re: What is strong point of RPG programming language?

                Originally posted by BenThurley View Post
                I've programmed to varying degrees in a number of languages including VB6, VB.net, C#, PHP, Java, C and JavaScript as well as the usual AS400 suspects like CL and RPG.

                I would say that they're all difficult in their own little ways. That's why programmers are paid favourable wages! Out of all of those I would say that only C was as hard as RPG. Java has the potential to be difficult, particularly if you're used to the procedural paradigm. However, I was lucky that I learnt this as my first language at uni so have no problem thinking in objects.
                hey u are right man!!!! u deserve total 100 man!!!!



                regards
                Young people knows how to run fast but old people knows the way..

                Comment


                • #9
                  Re: What is strong point of RPG programming language?

                  Originally posted by BenThurley View Post
                  I've programmed to varying degrees in a number of languages including VB6, VB.net, C#, PHP, Java, C and JavaScript as well as the usual AS400 suspects like CL and RPG.

                  I would say that they're all difficult in their own little ways. That's why programmers are paid favourable wages! Out of all of those I would say that only C was as hard as RPG. Java has the potential to be difficult, particularly if you're used to the procedural paradigm. However, I was lucky that I learnt this as my first language at uni so have no problem thinking in objects.
                  thus a problem arises. if your first foray into languages are object-oriented or event-driven you will be more likely to learn those types of languages faster than procedural, why? beside that's how you've learned to process the syntax. the same is true for procedural, if you learn procedural languages first then they become easier to learn. it's all the mindset of the individual. once you've wrapped your mind around how something works, it's hard to not think in that fashion. if you had learned RPG first, then you'd have the same tendency to learn object-oriented and event-driven languages at a slower rate and would seem more unwieldy. people are creatures of habit, and trying to go against almost everything you know about a subject is a daunting task indeed...
                  I'm not anti-social, I just don't like people -Tommy Holden

                  Comment


                  • #10
                    Re: What is strong point of RPG programming language?

                    There are some who may disagree, but I think the cycle is da bomb! I can crank out control break reports in no time at all. It tell you when you reach overflow so you don't have to keep track of how many lines of output you have written so far. Of course, the original abbreviation was Report Program Generator. (It's my understanding that RPG is now the name of the language, but is no longer an Acronym.)

                    Not to mention that the system opens the files for you (unlike COBOL, etc).
                    http://www.linkedin.com/in/chippermiller

                    Comment


                    • #11
                      Re: What is strong point of RPG programming language?

                      You simply use the right tool for the job... and when it comes to writing native programs on the 400 RPG works very well for creating reports, data entry screens and native access to the underlying database (as BenThurley mentioned) comes to mind.

                      In the last few years since IBM added features like /free, embedded SQL, and more and more built in functions (bifs) its just made it that much better.

                      @Chipper: Please don't mention the cycle... gah! by the way you don't have to keep track of how many lines you have output you simply check the overflow indicator and if its on write the page heading.

                      -John Andersen
                      ______________________
                      John Andersen is the technical editor for the Midrange
                      Newsletter covering the AS/400 and iSeries market. To
                      claim your complimentary issue of the newsletter go to
                      http://www.as400tutorials.com
                      Introducing The IBM i and AS/400 Training That 100% Guarantees You Will Learn Key Administration Tasks...

                      Comment


                      • #12
                        Re: What is strong point of RPG programming language?

                        Originally posted by John Andersen View Post
                        by the way you don't have to keep track of how many lines you have output you simply check the overflow indicator and if its on write the page heading.
                        Oops, I must not have worded that correct, because that's how I do it.

                        Code:
                        If (*IN40 = *ON);
                           Except Hdr;
                           *IN40 = *OFF;
                        EndIf;
                        Except Dtl;
                        http://www.linkedin.com/in/chippermiller

                        Comment


                        • #13
                          Re: What is strong point of RPG programming language?

                          Originally posted by bienvu View Post
                          Dear all,
                          I have worked with RPG III programming language many time,
                          ... ...
                          Why we have to use RPG to code while RPG is very difficult?
                          I think you may have answered your own question by telling us that you are using RPG III.

                          While I do not personally find RPG III to be hard to use I have been familiar with it for many years. I can believe that a new programmer coming from a PHP, Java or C background would find it difficult though.

                          Most of us who use RPG don't use RPG III. It was rendered obsolete by the arrival of RPG IV some 15 years ago. i.e. around about the time that MS introduced VB 4!!

                          Give the free-form notation of RPG IV I have found that most experienced programmers introduced to it appreciate the business oriented features of the language (decimal math for example - a "novelty" that languages like C and java have given up in order to be more platform independent - it doesn't work but they do it anyway) and have no problems getting their heads around it.

                          Just as a simple example:

                          Code:
                          PHP
                          
                          If ( $value > 250 ) {
                            $discount = 5;
                          } else {
                            $discount = 0;
                          }
                          
                          RPG IV
                          
                          If ( value > 250 );
                            discount = 5;
                          else;
                            discount = 0;
                          endif;
                          How hard can it be?

                          The simple answer to your question is that RPG is a business oriented language - its focus is on getting tasks that are important to real businesses done quickly and accurately. There's a reason many small banks and most casinos use it - accuracy matters in business.

                          Used correctly (i.e. with subprocedures and service programs) it can be used for anything from a simple report program to the most complex Ajax and web service based web applications.


                          Jon P

                          Comment

                          Working...
                          X