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



Having only programmed in RPG, let me state that readability is not based
on one persons viewpoint, I don't think the version you prefer is more
readable. Never having programmed in .NET languages I would have a harder
time understanding, That being said, The .net programmers would probably
like and get confused by what I prefer, readability is all based on what
you know.
A lot of options you suggest sound great to you, but why should RPG be
more turned into Java, Java already exists, use it where it makes sense,
and use RPG where it makes sense. I don't care that the whole structure is
returned I use the parts I care about and the system cleans up the rest as
was mentioned in an earlier email, Why add Garbage Collection, It's only
needed when you add the garbage in first place.




"Steve Richter" <stephenrichter@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
10/09/2007 09:18 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: will v6r1 RPG support main procedure recursion?






On 10/9/07, Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx> wrote:
From: Steve Richter

( On the .NET vs i5/OS front, the comparison that I am interested in
is languages that garbage collect vs those that dont. C++ used to be
important. Almost overnight, with the adoption of managed code by
MSFT, it is legacy because it does not GC. Garbage collection in RPG
would work really well for its many business oriented programmers. )

Okay, I'll relax the restriction for just a moment and answer this
question
even though you again are talking about a technical issue that really
doesn't matter to application programmers.

Why do you think RPG needs garbage collection? The only reason you need
GC
is when the programmer dynamically allocates memory outside of the OS
and
doesn't give it back.

a GC makes two basic building blocks of code cost free. procedure
return values and adding items to a collection.

When you have a GC you can write code like so:
CustomerRecord[] customers = GetListOfCustomers( arg1: arg2 ) ;

without it:
CustomerRecord[] customers ;
GetListOfCustomers( customers: arg1: arg2 ) ;
// dont forget to free the customers struct!

the GC version is more readable. It also runs without the penalty of
having to copy the entire CustomerRecord[] collection into the return
value. In a GC language, all that is returned is the reference to the
collection. In C, RPG and C++ a copy of the collection is returned.

When adding an item to a collection in a GC language you simply add a
reference to the item to the collection object. In a non GC language
a copy of the item is added. If what you have is a collection of
strings or rows from a database table, the performance cost can often
be too high and that simple, direct process becomes something complex.

-Steve

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.