POV-Ray : Newsgroups : povray.general : CSDL: C-like Simulation Description Language : Re: CSDL alpha 1 release Server Time
7 Aug 2024 05:21:27 EDT (-0400)
  Re: CSDL alpha 1 release  
From: Warp
Date: 24 Jan 2002 07:27:38
Message: <3c4ffdba@news.povray.org>
Alessandro Coppo <a.c### [at] iolit> wrote:
: Well, the whole thing about garbage collection, reference counting, etc. 
: etc. is just meant for NOT bothering about these details. I am working in 
: Java since 2000 (and in C++ since 1990..) and I find myself 10 times more 
: productive by just calling clone() on an object to create a copy than 
: messing around with templetazied smart pointers, idioms to ensure correct 
: destruction etc. etc.

  The main problem with Java's garbage collection scheme is that it destroys
the concept of class destructors, which is a very important concept in OO
programming.
  Destructors take care that everything that the object has allocated gets
freed when the object is destroyed (and this doesn't only mean memory!).
Destructors are safe because they are always called when the object is
destroyed, so the resource will certainly be freed when the object itself
is destroyed (either explicitly or because it goes out of scope).
  In Java this concept has been destroyed. Classes do have destructors, but
they may not get called at all, and even if they are called, there's absolutely
no guarantee of when and in which order they are called.
  This means that if a resource allocated by an object needs to be freed
immediately after the object is not needed anymore, you have to make your
own method for this and you have to remember to call this method. If you
forget to call this method, then bad luck.
  This means that if you have, for example, a window class, you can't put
the window closing routine in its destructor, but you have to make a proper
method for closing and then remember to call it everywhere it's needed (because
it's not called automatically by the compiler).

  This is just one example of a "feature" of Java which forces you to make
non-modular code.

  I find myself 10 times more productive with C++ than with Java.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.