iPro Developer recently featured an opinion article titled Is RPG Dead? by Mel Beckman, in which we were told that RPG is no longer routinely used to write new programs. Since, apparently, iPro Developer is now publishing opinions instead of facts, let me state mine: Almost all of Mel's points in this article were just plain silly, and based on an outdated perspective of what RPG is.
Since Mel's article was published, many loyal readers have asked me to write a rebuttal. I carefully thought out my response, and put together the following points, which I was going to turn into a blog post for Scott's iLand:
- Remind everyone that we've been hearing "RPG is dead" for 20 years now, and yet it's still going strong.
- RPG is the number one language on our platform. How can it possibly be dead? More than half of development on this platform is RPG!
- Modernization is not about which language you use. Languages are just tools. With a wide variety of tools available to me, I keep choosing RPG because it works the best for my business needs.
- Seems like Mel is still thinking about RPG as "RPG III"
- IBM has consistently enhanced RPG with every release, more so than almost any other tool on the platform.
- Why would Mel attack our biggest demographic?
So I was going to write this up as a rebuttal, but then something miraculous happened. Jon Paris and Susan Gantner (who were not privy the the above notes) basically wrote exactly what I had outlined in their blog. I didn't know how to respond to that -- what do you do when someone reads your mind, and then writes your article for you? I guess great minds think alike! Here are links to Jon and Susan's blog posts on the subject:
I've finally posted this blog entry because I thought of some additional things I wanted to say, in my own words, and this seems like the best place to do that. So here goes.
RPG IV is Not an Old Language
Mel's article implies that RPG is very old language. He puts it in the same category as Cobol and Fortran, and states that RPG was born in 1959. Here's my question: Is he referring to the original Report Program Generator language? The one simply known as "RPG", in the days before RPG II, RPG III and RPG IV were invented? If so, I certainly do agree with Mel that it's dead. The original RPG hasn't been used in decades, and in fact, never ran on AS/400. (Or even its predecessors such as the System/3 or System/3x.)
Or is Mel mistakenly thinking that the original RPG from 1959 is the same language as today's RPG IV? It certainly is not. The numbers II, III and IV do not represent versions of the RPG language! Each number represents a successor, a replacement for the previous language. If you're looking for versions, then RPG's versions are the same as the operating system versions, such as V3R2, V4R4, V5R3 and 7.1.
Confused? Consider the history of the C programming language. Originally, there was a language named B that was created by Ken Thompson at AT&T. It was not deemed suitable for the Unix operating system, so another AT&T employee, Dennis Ritchie wrote a whole new language that was inspired by B known as C. The C programming language is strongly inspired by B, there's no doubt about it, and its name is directly derived from B (the name C was chosen because it's one letter after B). But, they aren't the same language. Likewise, some years later, C++ was released. C++ is deeply inspired by C, and named after C, but it's a new language, it's not C. When Microsoft created C#, and Apple created Objective-C they were also named after C, and deeply inspired by C, but they are separate languages, they are not the same one.
IBM did the same thing with RPG. They came out with RPG II, deeply inspired by RPG, but not the same language. Then came RPG III when they needed a new language similar to RPG II, but with externally defined database files and structured operations. Likewise, RPG IV was a brand new language specification, inspired by RPG III, but completely reinvented in 1994.
So if Mel is saying that the 1959 RPG is dead, we're in complete agreement. I'd also suggest that RPG II and RPG III are dead and obsolete languages. (Unfortunately, I can't seem to convince many shops, including major application vendors, of that fact -- and they lumber on still creating new software in RPG III despite that it should be dead.)
But RPG IV? As a language created in 1994, it's not really that old. By comparison, both PHP and Java were released only a year later in 1995.
Yet, Mel even goes so far as to suggest that C (from 1972) and C++ (from 1983) are more modern languages. Are you kidding me?! Like RPG, I code in C every day, it's a big part of my job. And let me tell you, C is not nearly as modern as RPG. It's not even close. C and C++ can't even do simple string operations without you having to code manual memory allocation, bounds checking, and extra code to make sure that a simple string concatenation doesn't turn into a security hole. Its database access routines are nowhere near as simple or advanced as RPG's. Its date operations are awkward and clumsy by comparison to RPG. Don't get me wrong, I like C, especially for lower-level systems coding. But it's nowhere near as modern as RPG, nor as well suited for writing business logic.
But, maybe Mel doesn't understand that when today's authors refer to RPG, we really mean RPG IV. We don't bother including the "IV" every time we say it, because RPG IV today's RPG, and everyone should already know that!
What Features Are Important In Business Logic?
Before we go throwing around opinions about old, legacy, etc... maybe we should define what is important to us? What are important features for a language that's aimed at people writing business logic?
- Business logic uses numbers heavily. Numbers represent quantities, prices, and weights. These are key to almost every application in the business world. Very few languages today support numbers with true decimal-based arithmetic (as opposed to integer and floating-point which are ubiquitous). Java supports decimals properly, but only by working through complex classes. RPG supports decimal numbers simply and easily, because they are the default numeric data type in RPG.
- Business logic uses databases heavily. Almost every business application is database driven, and database access is deeply integrated into the RPG language. Native record access is simple and powerful. Even more powerful is SQL, which is an order of magnitude simpler to code in RPG than it is in many other languages such as PHP or Java.
- Business logic uses dates frequently. Whether you're checking when a customer's payment is overdue, managing inventory turnover, determining when an order should be shipped, or when an employee was hired, you need to work with dates in a simple and effective manner. Today's RPG does that. Many other languages have APIs or classes for working with dates (this includes Java, PHP, C, C++, etc) but in RPG they are built right into the language, and that makes it simpler.
What Does a Dead Language Look Like?
The demographics we get from surveys that iPro Developer has sent to our readership tell us that the biggest group of our readers are RPG programmers. By every study I've seen, RPG is the number one language on the IBM i platform, and I strongly suspect that if RPG did die, the platform would die with it. Does that sound like a dead language, or a thriving one?
With every release of IBM i, RPG has been given new features. In fact, almost every release of IBM i, RPG IV receives more new features than RPG/400 did in its entire lifetime. In fact, many of the other IBM i development languages see far less development efforts than RPG. (This includes C, C++, Perl, and Cobol.) Does that make you think that RPG is a dead language, or a thriving one?
The most popular discussion forums for developers on both iProDeveloper.com and Midrange.com are the RPG ones. Does that sound like a dead language, or a thriving one?
So what does a dead language look like?
Well, consider REXX for example. IBM still provides it for free with every copy of IBM i that they sell. It's quite a nice language, easy to learn, and powerful. But, hardly anyone talks about it, it receives no development from IBM. That doesn't mean that IBM is not willing to develop it, but there simply isn't any call for it. Why isn't Mel Beckman writing opinion pieces about the death of REXX? Because, honestly, Mel is in the business of writing articles that people will read. Nobody would even bother with an article about REXX being dead, because so few people ever use REXX. Does this sound like a thriving language or a dead one?
The same argument could be made for Net.Data. A powerful, useful language that makes it easy to build web sites. But, it has failed to gain critical mass. In fact, when I brought it up to a group of IBM i developers recently, they thought I meant Microsoft's .NET platform, they hadn't even heard that Net.Data existed, and they were IBM i developers, not Microsoft ones! IBM has promised to support Net.Data for the forseeable future, but hardly anyone uses it. Why isn't Mel writing about Net.Data? Again, because there's no audience!
Think about this for a minute: A language isn't dead when someone is merely calling it "dead." It's dead when people stop talking about it entirely.
Make No Mistake About It
There are some folks out there that might read this blog post and think that I'm saying it's okay to keep writing code in the same old way they wrote it circa 1990. These are the people who write RPG IV code the same way they wrote RPG III, with fixed-format calcs, all one big monolithic program, with green-screen user interfaces and native I/O database access. I am certainly not saying that.
In today's world, you should write business logic so that it can be reused, and each routine should be written so it can be rested independently of the others. In RPG, that means writing business logic as subprocedures that can be run independently for test purposes, and later, called independently from many calling programs.
For any data that can be organized into sets or queries of data, you should be using SQL, not native I/O, and certainly not OPNQRYF.
And modern code should be capable of being used from a variety of user interfaces, including green screen and printouts, but not limited to them. Mobile devices, rich web UIs, Excel spreadsheets, and PDF documents are great examples of alternative user interfaces you should support.
And although RPG is not dead, it's also certainly not the right tool for every single job. You should learn new programming languages. Even if you never use them again, simply learning other languages and exposing yourself to different techniques will stretch your mind, and improve you as a programmer.
Scott, Why Are You Writing This?
My biggest concern is our platform seems to always be under attack by its competition. The competitors out there are always trying to find evidence that experts think our platform is legacy or outdated. An attack on our platform, however well-intentioned, is very bad for us.
I see Mel's article as one such attack. It brings about a lot of negativity, not just from Mel saying that the number one language of the platform is dead, but also from others who say things like "Mel should retire", or "I've lost all respect for Mel Beckman" (comments I've heard frequently since he posted his Is RPG Dead? article.)
Clearly, Mel was trying to make people think. I mean, you can't seriously consider RPG a dead language when it's the number one language on the platform! Mel is no dummy, he wants people to think about it, think about what they like about RPG, and to seriously consider other languages when they are appropriate. All of this is admirable!
But I would much prefer to see that done in a constructive way rather than a negative one! Show RPG developers what they should be doing, and how it'll make their jobs simpler. Put some technical content out there that they can really use, and makes their job easier.
Don't attack them and make them feel obsolete. Especially when they aren't.