Midrange News for the IBM i Community

Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Is it time to move to C or C++ or Java?
has no ratings.
Published: 08 Feb 2013
Revised: 11 Feb 2013 - 2166 days ago
Last viewed on: 14 Jan 2019 (4067 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Is it time to move to C or C++ or Java? Published by: Bob Cozzi on 08 Feb 2013 view comments(3)

While Java continues to suck, that language along with C and C++ have a consistent albeit sometime confusing syntax. But in order to move away from some legacy syntax exposures in the primary development language of IBM i, perhaps it is time to take another look at these languages.

Sure in C it is nearly Rocket Science to move field A to field B like you can in RPG or COBOL, but aside from that one thing (oh and the == for compare) it may be something we can get use to.

The only thing missing is some concrete "SUBFILE" examples in C or C++. Sure SUBFILES are obsolete but they are still the first thing IBM i developers ask for (ask how to code) in any programming language. Perhaps there's an example out there, but I haven't found it yet.

The Record I/O in C on IBM i is great compared to other platforms. For one thing, they have full access to the _Rxxxxx APIs which is the underlying support behind the CHAIN, READ, SETLL and other RPG database opcodes. Not to mention full support for embedded SQL.

The good news is, unlike RPG, the C languages have Macro Language support. So you can write macros that mimic an RPG EVAL (or MOVE) opcode fairly easily.

Back on AS/400 we had a variation of C called System/C which was basically the MI language wrapped in C. It was very powerful. We put together a ton of functions and Macros to make using C "safer" on OS/400. So things like CUSTNAME = WRK1 can be performed in C safely, using Macros.

I'm a big fan of PL/I and RPGIV. But the legacy decisions in RPG syntax are holding it back. IBM could fix this with an "RPG V" and just tell programmers to adapt, but I don't see them doing that anytime soon.

The advantage of things like C is that you can cut/paste code from the web and use it on IBM i, but really, you're not going to convert you legacy order entry program to C or even C++ any time soon.

But for new app development, maybe its time to think about C/C++ again.

-Bob Cozzi

Java sucks, move along.

Return to midrangenews.com home page.
Sort Ascend | Descend