- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
Maybe RPG sucks, but (hopefully) his point is that there's nothing wrong with a programming language that runs in an implicit loop. AWK is one of my favorite languages and I relish every opportunity to use it.
Basically, your code gets called once for every line of a text file that you pass through it and the language gives you super easy ways to access the whitespace-separated fields of it. For example, to print out 3rd column of this file: a b c d e f g h i j
I'd write an awk program that looks like this: { print $3 }
And it'd print: c h
And you'd run it like this: awk '{ print $3 }' file.txt
Imagine doing the same thing in Java: You'd need to define a class, a main(), Readers/Writers, trys, catches, probably make use of String.split, a loop, etc. Running it would require calling the compiler then using the java command...
I wouldn't use awk to make a webapp framework, but it's an extremely useful language to know.
Admin
Somehow, I should have expected that it exists.
Admin
Since Awk is under discussion, here's an old chestnut about Awk in AI. Apparently, Awk and Perl (with Awk on top) were beating out C++ and Lisp within student submissions.
Admin
What can I say?
I sympathize!
Admin
Thank God my beloved Javascript/ECMAScript made the cut.
;)
(Oh, and TI-Basic on my graphic calculator!)
Admin
Maybe the real WTF? is a college grad not knowing how to spell "appreciation?" :p
Admin
My high school (rural Missouri) still teaches RPG II and Cobol. When I went there in the early 90s, I just thought that's what everyone used to program in the business world. It didn't help matters that the teacher would often say retarded things like, "This is how it's done in nearly every business out there." She thought that "new-fangled C" language was a waste of time.
Being young and impressionable, I believed her. I'm so lucky that the first time I saw my first C file I instinctively knew I had been wasting my time in high school, and did a complete 180 --instead of just trashing it to my new college-friends. Can you imagine? "Why are they teaching us this 'new-fangled C' language? I've always been told it was just for fringe developers. REAL coders do it in RPG II!"
Admin
am I the only one who cringed every time there was incorrect apostrophe use in "60's, 70's" etc? And "adaption"? You either mean "adaptation" or "adoption".
/grammar nazi
Admin
Admin
I don't see that other post. I think the frist psoter jsut mdae taht pu so he had something to reply to. Boy, I hate people who do that.
Aw, shut up, dead man.
Admin
Just in case you're not already aware of this-- you suck at manners.
Admin
Sounds like there are a number of people who need to be introduced to the business end of the other other kind of RPG
Admin
99.9% would be a massive understatement. I'm about to leave a .com where I've been the as/400 administrator for several years. I've been with the company for 7 years. During that time, the AS/400 had 3 unplanned system outages. 2 were when someone cut the power, ran down the battery backup, and every system in the building went off. The 3rd was when we lost 3 out of 45 drives in a 24 hour period (2 were on the same array... ouch...). If I remember correctly we lost about 4 or 5 other drives in other systems that day. I don't know what happened... Maybe sunspots?
Downtime for the power being cut unexpectedly was less then 1 hr each occurance. Downtime for the drives blowing... about 4 hours... and that included lag getting hardware people out to try to get us running again... We managed to revive the system with no data loss, and only minimal recovery needed.
As for the AS400, it doesn't suffer the way SQL server tends to. It handles locks MUCH more gracefully, and it doesn't let processes take over the system.
I will admit... I HATE RPG coding. But, it is a small price to pay for a rock solid system. Particularly since you can usually avoid it by going to a web based programming language on a windows server for the less mission critical applications.
Admin
ummm... I've used RPG quite a bit... Old style green screen editor. The columns are clearly marked to remind you what goes where, and you can set up rule lines to make it even more obvious. The fixed positioning is the least of the problems. Decoding some of the thrown together in a rush garbage that's out there is however a big problem but that's true of ANY programming language.
Admin
大丈夫ね。Zylonさん、あなたはJapaneseがsuckだね。
Admin
Admin
Admin
Actually, I know some Linux System Administrators that would be delighted if they could achieve 3 9s of availability. How are you doing it? How do you apply maintenance to the OS?
Admin
Admin
Hmmm. Green screen terminals old-style, eh?
They were pretty good when they replaced the IBM 029 keypunch machines, ya know. All this fixed-field programming fit the paradigm real well in the days when keypunches and Hollerith cards were the only way to get programs into computers.
The 029s had this little box, by right knee, full of this really hazardous confetti called "chad" -- the holes punched out of the cards. Chad enjoyed a comeback worthy of its true nature in the 2000 Florida election.
Insert mode? Jam your thumb onto the card in the DUP station while typing onto the card in the PUNCH station. Clank clank clank.
In the old FORTRAN days, the field layouts were: 1-5: line number A "C" in column 1 meant, duh, a comment. 6: anything nonblank meant "continuation line." 7-72: the statement 73-80: card number. You needed these if you dropped the deck of cards or the card reader went bananas.
I never got to use RPG, but, we did some decently cool games and 3D graphics work with FORTRAN!
Believe it or not, all this fixed-field stuff made perfect sense at the time on those keypunch machines.
But, as soon as the green screen terminals (the ADM-3a machines I used were actually kind of bluish) got lower case, the 029 keypunches went into the crusher, and nobody looked back.
Admin
Admin
You gotta love Google AdWords. The front page had a banner add seeking MUMPS programmers. Just the sort of background material you need before clicking on the ad.
Admin
Interestingly, I got a summer job this summer at a company that still is using several AS/400s (one at each location) to handle almost every single bit of the company computing stuff. Email, webserver, file server, and all sorts of custom accounting, inventory, sales programs run on the AS/400.
Scary that I recognized the language when I saw the title, and I'm not even out of college yet. Lucky for me they haven't made me learn any RPG yet.
Admin
If RPG is not wtfy, nothing in the known universe is.
Admin
I went to a silly 6 month techie school in 1982.
I had already taught myself BASIC, so I "tested out" of that course.
The next was MF Basic Assembly Language. That was OK.
But the real pain was COBOL. Now that just sucked. But while they taught me COBOL, I was teaching myself RPG II on the same system (a Sperry monster).
A COBOL program may have been 10 pages, the RPG would be 2. And there was no hassle about placing things in the right columns. There was a special RPG editor that knew what they were for. I liked it much better than COBOL.
My older brother (who I was living with) had a job as an RPG programmer on a S/34. So he was very helpful.
Fast forward 20 years. My brother went from S/34,36,38, and then AS/400. He was a wizard with the command language,and carried a SQL install tape everywhere he went just in case he needed it.
I went through MS-DOS, Xenix, Unix, Windows, Solaris, and then Linux, coding mainly in C for the 1st 10 years, and Perl for then next 10, but using many other languages of course.
And then I had him hired at the same company I worked for, under the promise he could be productive in Perl in a couple of months.
MISTAKE!
The RPG caused way too much brain damage. As pointed out by someone else, the concept of scope could not be imparted. He loved his global variables. Nor functions or modules.
He would code 100 page programs, all cut and paste hacks, without understanding the concept of factoring. No matter how hard I tried.
I ended up doing his job and mine for about 6 months.
RPG may be fine for AWK style report loops, but it has been twisted and contorted into doing much more, which in turn has destroyed many possible programmers.
Captcha: sanitarium How appropriate.
Admin
Ah, yes, but like the original article and several other posters mentioned, the very reason for the column-based programming was that it lends itself well to punchcards and forms where the columns can be clearly marked.
Admin
An AS/400 (or iSeries as it is called today) is capable of running (RPG, COBOL, PL/I, etc.) programs of 20-30 years ago. And it doesn't really matter in most cases whether the source code is gone: it runs and without complaining. IBM has provided tools (for free) to do a rudimentary conversion of code in ye olde column based style to /Free and there are commercial tools available which even do a rudimentary sort of redesign of the sources. So actually all the RPG and AS/400 bashing here is uncalled for. I have been working with the platform for a happy 15 years now and never regretted one single day of working in RPG. As the editor has so friendly stated all kinds of cool things have been introduced recently by IBM to take all the developers off the much lamented green screens and into the GUI based development (Code/400, Eclipse, and a myriad of other tools available) and the support of the 20-30 years old code is still there, alongside tools to convert that old muck to nice, new, gleaming, sparkling new /Free code. As far as I can see the only flaw of IBM in this case is the fact that they have kept on supporting the old code, not having dropped one single command in all those years (until 2001 that is, and only then they dropped a very insignificant opcode). This backward compatibility has given the old dinosaurs all they needed to win the argument with the eager developers willing to take on the new stuff. So: please, stay off of the bashing of RPG and AS/400 unless you are able to reproduce an as solid pair of language and hardware platform.... I dare you... the gauntlet is down...
The real WTF here is the inability of a code dinosaur to come up with a name which expresses the function of the function (or rather procedure) he wrote...
Cor Takken
Admin
Admin
Admin
There is no RPG.NET because all applications written in RPG are intimately tied to the AS/400 architecture. To port it to windows, one would also have to port the non-relational (DB/2) database engine to windows, as well as the Library File System, and a windows implementation of the 5250 terminal. You'd then have succeeded in building something that combines the worst aspects of both the AS/400 and the Windows PC. I cannot imagine there being a market for this.
RPG programs tend to be either pure batch processing, or the conceptual equivalent of a query + user interface. Just rewriting your RPG apps in MS-Access or Oracle Forms would be infintely more cost effective, I imagine.
Admin
Another amazing article on a Pretty Much Dead language. But there are still so many of these weird languages left in the Legends and Tales. Please, tell us more about these fascinating unreadabilities from ages past!
How about JCL next?
Or AWK? (...and with that, this Perl guy prepares to run...)
Admin
Well, I work in the team that is tasked with migrating our bank from an old AS/400 system written in RPG+DB2 to a new spiffy market-leading banking system that is written in Oracle Forms+Oracle. I got to admit that the old RPG system works faster and has a better UI. And my coworker likes to talk about another banking system he used to work on, written in MUMPS+Cache. Worked faster than any RDBMS-based system. Don't bash a language or a technology just because it looks ugly, like I bash perl.
Admin
Ah. Kind of reminds me of the Forum Software. You never remember which days it uses bbcode, which days it uses HTML, when and how it breaks the paragraphs, and when (and if) it's safe to preview =)
Admin
A former collegue of mine translated the letters "RPG" into the German words "raten, probieren, glauben" (guess, try, believe).
Admin
Absolutely agree. FWIW my neighbour actually drives (CO2=second etc) those big container ships or on survey ships etc. Anyway he knows all about astronomy for navigation purposes and actually uses his sextant to figure out stuff to this day - or so he tells me. So there you go.
Admin
Admin
How come you have the first post by quoting somebody else?
That's a real WTF
Admin
How come you have the first post by quoting somebody else?
That's a real WTF
Admin
If you are really doing language WTFs then chek this out:
http://members.tripod.com/rkusnery/weird.html
Especially the Brainf*** and Doublef*** should come to your attention. I'm pretty sure that one day there will also be a WhatTheF*** version of those.
Admin
The real wtf is that so few understand what it can do. In a fraction of the time, a business problem can be solved. Excellent, modern, maintainable code can be created and implemented so rapidly, but yet all that anyone seems to know are the seedy sides. And the seedy side described on these pages is mostly inaccurate, beginning with the original post. It is wtf, and it is too late for me to even begin wasting my time responding to the garbage spewed forth in these posts. I've got to get to work. I'm getting $150 an hour these days, sitting in my easy chair at home, writing RPG. Some of what I write is beautiful, elegant, modern. Some of it is 80 byte fixed-format "punched card" stuff. It pays the same.
By the way, do you realize that that old code might be 30 years old, but still works, without recompile, on the newest hardware? I've spent some time in C# and Java and did time with VB6 a few years ago. All these serve purposes too, but no way are they as productive and long-lived as RPG.
Admin
There are a lot more fixed format restrictions in RPG than what are listed here. Especially in the other specifications. There are different types of lines in RPG (Header, File , Definition, Input, Calculation, Output) and each type of line has it's own fixed format to deal with.
Calculation lines are where the programming logic are done.
One of the "upgrades" that I liked for RPG was the use of built in functions. I could now do a table lookup (opcode CHAIN) and use the built in function %Found to check if a record was found.
Prior to that you had to use in column 71-76(HiLoEq). Then you had to check if the indicator was on or off. For a table lookup (opcode CHAIN) an indicator in Hi position (71-71) would indicate that a record was not found. An indicator in the Lo position (73-74) would indicate that there was an error when doing the chain operation.
then you would set up lines of code that would work based on the indicator being on
99 EMPNO ADD 1
With modern RPG, you could do
........ Which at least is a little less cryptic
Admin
the problem might be, that you can't click with your mouse within 5250 sessions. greenscreens are unefficient and old relicts. this isn't web2.0 compatible and therefore your users take longer to accomplish tasks as they would with windows/gui programs. so as400 is bad. rpg is too old and uncool.
i hear this stuff all the time, mostly from my boss or customers.
once they see how fast you can manage data on greenscreen apps with keyboard buffers and fast as400 systems they think different.
...for a few months.
then some consulting guy comes and tells them how fast everything is with their new windows app or gui programming language. and i have to convince them again :)
we are a pretty big shop here, with 15 iSeries systems across europe and a few million lines of rpg business code, which grew over 20 years. i program rpg now since 5 years and still can't see anything complicated or antiquated in modern rpg. i use socketprogramming, http/ftp apis for SOAP calls and a lot of other stuff. because of the ILE concept i've been mixing c++, java, cobol and rpg routines within one program for years (hi @ .net).
i just can't use .dlls ...
Admin
Okay, my turn. To get the 3rd part of all records related to the A-E bind of an encyclopedia, I would write this:
Using this list
echo X 3 Warner Afghanistan Y 1 Jake goat Z 4 Pete algae X 2 Warner Jordan Y 5 Jake
makes it print
3 1 2
Admin
Hah, we use that garbage. It's such a pain in the ass only having 6 characters to name a field. To make it worse, the last two characters of each field represent the table name/flat file. So we get to use 4 characters to describe our fields. Ew.
Admin
Er.. they are called service programs... you can't use Windoze .dlls, but why would you: you have a whole myriad of Unix C, C++ functions at your disposal and cross language calls (RPG to Java, RPG to Cobol, C++ to RPG, etc. and all vice verse).. Try to do that on a different platform... no RPG's for me the language.
Admin
Oh ye of little faith. Is open mouth insert foot the rule on this site?
64-bit in 1995. Subsecond response via sql over 100,000,000 record table. Call C++, Cobol, Java, Domino, and output in HTML. All within one rpg program.
Show me another language that can do that and not require recompiling whenever Bill Gates upgrades his toys.
An OS that runs AIX Unix, Java, Websphere, Domino, PHP & MySQL and OS/400 and shares all the same disk drives and can be backed up and restored using one tape.
Show me another hardware platform that can do that.
RPG programmer since 1984, and yes I'm a dinosaur but I do use modular code and free form and I have been known to learn new tricks.
You guys really need to do your homework before getting your panties in a bunch regarding things you know little about.
Admin
The WTF that I see with this article and many of comments made is misinformation and improper comparisons. Like the PC, the AS400 is only a machine that has OS running on it. Unlike a PC, the AS400 can multiple flavors of OS on it at the same time including Linux. The statement regarding the 99.9% uptime is truly one of the greatest understatements of all time. The database has always been a relational data base with AS400 operating systems.
As to the main issue of the article, RPG has been slow to develop as some of stated. I would venture to say that is more because the market did not drive the progression. I have seen some leaps of improvements in the language in the last 10 years. I would agree that many RPG coders are reluctant to learn the new opportunities with the language. When I started getting into these new opportunties with the language, I could not get enough. I saw a remarkable number of transactions being processed for online trading at a previous employer. All the software was written using RPG programs. The RPG programs would generate the html, send it to the AS400 web server, receive the page back, process the information, and send the next page.
In the last two years, I have written RPG applications that can interface with Java, VB, C++, and many other languages directly.
I would like to say that I have created application in RPG, Java, and VB in recent years. Each has its own place where it is a better choice than the others.
In summary, there is absolutely no way that either RPG or the AS400 is worthy of a WTF. As one of the other posters stated, it is very hard to find a better combination than the AS400 and RPG for cost and performance.
Admin
Suddenly my job looks like the greatest job ever and I have no complaints...
Admin
Sounds good, except that you can't use procedures in RPG that way.
Procedures can be used in fixed format or free format like so:
So PutClientNo was a poor name choice. But, I've seen poor choices of names in Java, C, and C++ too.
Now what's really interesting, is that MyProcedure() and MyFunction() could be written in any number of supported System i languages including RPG, CL, COBOL, C, C++ and Java.
The ILE in "ILE RPG IV" stands for Integrated Language Environment. ILE provides a common environment for System i languages. I can create executable *PGM objects and library *SRVPGM objects (basically a DLL) from modules written in any of the System i ILE languages.
Now this ought to sound familiar to you .NET programmers. Of course, us RPG programmers have had this feature since 1994!
Admittedly, there's plenty of dinosaurs on the System i, but there's plenty of modern developers who do .NET and/or Java along with RPG.
One of the greatest strengths of the language and the System i platform itself is also the source of their greatest weakness: the code I write today will still run 10 years from now. Even after OS upgrades, and new versions of RPG are released. For a business system, that's invaluable. But it makes it easy to stay stuck in the past.