× 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.



Hello Hans,

I don't think you should regret adding pointer support to RPG IV.  Giving
us pointers has meant that RPG can now do many things previously
impossible or only posible with difficulty and truly ugly data structures.

Four major benefits from having pointers are:
        1/ Based storage which makes processing user spaces easier and
faster than the alternative and gives us access to dynamic storage thus
more flexible array processing
        2/ The ability to invoke C-runtime functions including those which
expect char** data types
        3/ Cleaner code -- there is a valid aphorism regarding coding that
states "Get the data structures correct and the code falls into place".
It manifests itself in general as:
                complex data strucures = simpler code
                simpler data structures = complex code
        4/ Function pointers which give us dynamic call-back ability and
therefore the ability to allow procedures to be enhanced or modifed by the
caller -- if they've been designed correctly.

Just because certain programmers misuse or misunderstand pointers is no
reason for you to regret providing them.  Carpenters cut themselves with
chisels every day but that's no reason to remove chisels from the toolbox.
You cannot protect the fools from themselves and if you try then you
simply irritate the rest of us.

I can think of only three peculiarities involved in providing pointer
support:
        1/ Not allowing pointer arithmetic in the first release
(thankfully that has been corrected but it was obviously a misguided
attempt to protect RPG programmers from themselves)
        2/ Automatically declaring a pointer used in based storage (and
I'm in two minds about that -- I frequently use that ability to advantage
but like others get bitten by misspelling the pointer name which in
reality is no worse than misspelling a field name)
        3/ Not allowing BASED(%ADDR(somefield)) (which is likely to be
fixed sometime in the future)

The RPG compiler team is doing a good job on the whole.  There are
certainly peculiar things done and I would certainly do some things
differently but mostly everything you do improves the language (regardless
of what Bob Cozzi would have us believe).

I would not want to see typed pointers in RPG but I do want to see
user-defined types (even COBOL has that ability!).  That's long overdue
and I would spend my entire $100 on that single enhancement.  Then we can
move on to overloaded procedures, he says hopefully.  I'd far rather see
new features in the language than new ways of doing the same old stuff
(e.g., %CHAIN, %READ, jeez give me a break :)

Regards,
Simon Coulter.

--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists
   http://www.flybynight.com.au/

   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175   mailto: shc@flybynight.com.au   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.