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



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.