On Tuesday 26 March 2002 19:47, Ronan Waide wrote:
> And I'd disagree. Yes, you can make a horrible mess with things like
> object creation in Java, but that is frequently down to poor language
> semantics, such as the immutable String class vs. the mutable
> StringBuffer class, and the constant need to invoke various classes to
> convert data from one format to another.
So are you saying that there could be a programming language with
memory management that always does the right thing, without you having
to know what it's up to? (I say could be because I don't know of one
that does this...)
> Pass-by-reference and Pass-by-value are somewhat red herrings in this
> discussion (outside its scope, perhaps) since they are calling
> conventions and nothing to do with memory management - a powerful
> enough language will support both methods and allow you to choose the
> one that makes sense for your application.
It's quite relevant. In something like Python, where reference counting
is used to decide when an object is to be killed, you need to know that
you are, in fact, passing references around, not copies, so if you
save a reference somewhere, you are prolonging the life of the object.
As opposed to making a copy of the object, and doing something useful
with that. Of course, no sane language would pass objects around by
value by default...
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!