× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Tom Liotta wrote:
rpg400-l-request@xxxxxxxxxxxx wrote:


 4. Re: back to: improving rpg.  was: what is object oriented
    programming


I only have a few comments to make...

1. OOP <> OOD -- however, I do agree that the two have close ties.

2. C++ is a commonly referenced OO language and it is available on iSeries. When C++ compiles on an iSeries, are there W-code instructions that could not possibly be generated through some change to the RPG compilers? If not, then there is no technical reason that RPG could not be extended to become RPG++ (granted, that may be a totally stupid thing to do for numerous reasons). The point is that even current OO languages, once compiled or run, if interpreted, are ultimately nothing more than some sequence of _machine_ instructions, regardless of whether they are compiled or interpreted. There is nothing "magic" about what language the programmer creates them in; it's all due to the compiler/interpreter/whatever.

3. My personal favorite for introductory playing with OOP has been Object REXX. It's REXX essentially as we've always known, with extensions for objects. It shows _possible_ ways RPG might be extended for similar capabilities. (I'd LOVE to see OREXX/400 as the standard REXX on iSeries.)

For me this thread should focus more on "If I want THIS aspect of OO in RPG, then I code modules THIS way." For example, an RPG module _could_ "encapsulate" its data more or less simply by ALLOCing/DEALLOCing memory, and nothing else would touch the "data" of that "object" except through the "methods" -- procedure interfaces -- provided by the module. Crude example, sure. But it gets more to the focus of this list.

Any chance the future discussion could go in that direction? By discussing actual implementation techniques, it _might_ become clear that there really are extensions IBM could make that would be valuable. Otherwise, it's all OO academic and not RPG.

Tom Liotta


Regarding C++, the fact that both the C++ and RPG IV compilers generate W-Code doesn't help one bit in adding OO-ness to RPG. There's nothing in W-Code that's specific to OO programming.


Regarding Object REXX, yeah, that's a nice language, and shows that OO languages don't have to be complex and hard to learn. I haven't played with O-REXX for years, though - other interpreted OO languages are much more pervasive these days. (Google shows 200 times as many Python hits and 2000 times as many Perl hits than Object REXX!)

Can Object REXX be used a a model for an OO RPG? I doubt it. REXX (the non-OO variety) is a "typeless" language to begin with, and so O-REXX doesn't have to maintain the baggage associated with different predefined types.

Regarding adding OO features into RPG, here's something I've noticed (and I may well be totally off-base on this). When people ask for particular specific features, they seem to be features not specific to OO per se, but rather to the realm of "modular programming". Or rather, to the realm of just plain good programming practice.

For example, defining "get" and "set" methods to access particular pieces of data within an "object" isn't really a part of OO. While it's a technique commonly used in certain OO languages, "encapsulation" is more an aspect of "modular programming".

What's my point? Discussing how RPG IV can or should be improved is a good topic for discussion. But please please please, let's discuss features on their own merits, and not just because there's a belief that some particular feature is OO. The latter simply re-inforces the idea that OO is just some buzz-word.

A more productive discussion, though, might be how to adopt the lessons of modular and OO programming in *current* RPG programming.

Cheers! Hans



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.