POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 10:32:30 EDT (-0400)
  Re: Object Oriented POV code  
From: Dan P
Date: 20 Feb 2004 12:25:39
Message: <40364313$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:40363a68@news.povray.org...
> Dan P <dan### [at] yahoocom> wrote:
> > 32 comparisons for /one lookup/. Multiply that by, say, 100,000 lookups
for
> > fur.
>
>   Using 'new' will not help. There will still be 100000 lookups in a loop
> regardless of whether there's a 'new' or not.
 >
>   The whole point in this is whether 'new' is useful or not. It isn't.
>
>   Besides, there's no need to initialize an instance with the = operator.
> You don't have to do that in C++ so why would you need to do it in this
> scripting language?
>   You can simply say:
>
>   Color myColor(.1, .2, .3);

For the initial instance, sure; that's why C++ didn't both putting a new
there. But, what about assigning myColor again? Are you saying just do
another Color myColor(.1, .2, .3)? I'd find that just confusing. But, that's
me.

>   (Instead of "Color myColor = Color(.1, .2, .3);")
>
>   No need for 'new', and there's no ambiguity.
>
> > >   There's a reason why in Java everything is not an instance of a
class.
>
> > I think everything should have been.
>
>   Really? Then good luck trying to write things like "a = b+c;" in Java...

Smalltalk does that nicely... I don't see the problem.

One of the disconnects here is that I keep thinking in terms of a compiled
language, not a scripting language. It would be nice if we could compile
parts of our scenes into objects. But, I fear I'm opening a Pandora's box
even suggesting such a thing. It would make for interesting conversation, I
think (but most likely, just flames).


Post a reply to this message

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