Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
Is it time to move to C or C++ or Java?
has no ratings.
Published: 08 Feb 2013
Revised: 11 Feb 2013 - 1504 days ago
Last viewed on: 25 Mar 2017 (2924 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

COMMENTS

(Sign in to Post a Comment)
Posted by: Ringer
Premium member *
Comment on: Is it time to move to C or C++ or Java?
Posted: 4 years 1 months 11 days 19 hours 26 minutes ago

No PHP huh? Java/C/C++ have more demand it seems. RPG sits proudly at #38 in the list.

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Chris Ringer

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Is it time to move to C or C++ or Java?
Posted: 4 years 1 months 11 days 17 hours 59 minutes ago

PHP is a long-term fad. The new web language will come about in a couple years and people will dump PHP for this cool new language (whatever it is). Today it is the better choice over JAVA for web applications, but just at it displaced Java, something will eventually displace PHP.

Posted by: renojim
Premium member *
Comment on: Is it time to move to C or C++ or Java?
Posted: 4 years 1 months 11 days 16 hours 39 minutes ago

In the thirteen years I've been with my current employer, we've gone from green screen Lansa to Visual Lansa to RPG to PHP and now are hard charging into java. As far as I'm concerned, whether it's the straightforward git-er-done RPG approach, or the convoluted, high flyin', propeller head waste of time java approach, in the end, it's all just a bunch of 0's and 1's on a disc somewhere. Doesn't matter to me - as long as the paycheck's don't bounce, I can pretend to be a java programmer just as well as I pretend to be an RPG programmer.