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



Steve Richter wrote:

On 8/21/05, Kyle Goodwin <goodwink@xxxxxxxxxxxxxx> wrote:
Steve Richter wrote:

The reason is managed code. Managed code allows the programmer to do
two core functions with ease. Return an object from a function call
without the necessity of copying all the bytes of the object ( in c#
you return a reference to the object.  in traditional languages like
c++ and rpg you return a copy of the object ).  By the same mechanism,
managed code allows an object to be added and removed from a
collection or list without the performance penalty of having to copy
the object.


You can easily return a reference to an object in C or C++ via a pointer
(*) or in C++ specifically via a reference (&).  You can remove a member
from a list/collection by unlinking its pointers from the list and
returning a pointer to the object if you want to use it or using
"delete" on it if you just want to deallocate it.  Neither of these
require copying the object.  None of the things you mention here are
properties of "managed code."  What managed code does for you,
basically, is handle the memory allocation/deallocation dynamically
without your having to invoke new, malloc, delete, or free.

I dont know Java but in c# you certainly have to "new" each object. In C++ you use smart pointers to do what managed code handles
automatically.  We can argue this if you want but the proof for me is
the fact that just about all the windows c++ application programmers
have switched to c#.  c++ .net handles managed code very well.  The
ease with which c#  exposes the features of managed code trumps all
the bells and whistles that c++ provides.

Java no doubt is in the same league as c# as a great language.  Can I
move my rpg sql programming to java?

-Steve

I'm not arguing that C# and/or Java are not good languages, I'm just pointing out that none of the things you mentioned in the quoted text are properties of managed code, they're properties of any language with pointers. You do need to use new in both C# and Java, but that's really not the memory management I was referring to; it's the deletes and frees which can cause troubles (memory leaks, crashes if you free an already deallocated pointer, etc.). In retrospect I probably should have left "new" out of that final sentence.

--
Kyle S. Goodwin
Extensicom LLC

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.