POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 14:15:37 EDT (-0400)
  Re: Object Oriented POV code  
From: Tek
Date: 22 Feb 2004 16:29:01
Message: <40391f1d$1@news.povray.org>
> __normal_iterator& operator++() { ++_M_current; return *this; }
>
> That's the ++ operator for one of the STL iterators. And it does make
> sense to do it this way...other operators have to do more complex
> things, but it still makes sense to have a ++ operator.

Damn, I'll grant you that's a good example :)

> > prevents people writing lines like a = b + 3*(c-d), which looks
> > perfectly innocent, but could be a major bottleneck.
>
> All the coder has to do is look at the types being worked on.

Which is not as easy as just looking at the name of the function being called. I
realise this sounds messy and cumbersome to you, but this "mess" is actually
information that we find useful for our application.

> And this
> still isn't an argument against the existance of operator overoading.

I never said it was!!!

I like operator overloading, I'm just explaining why we don't use it where I
work (or indeed at the last place I worked either).

> > We like the clunkier syntax *because* it is harder to use and requires more
> > thought from the programmer. In our situation this is a good thing.
>
> But it requires more thought about the wrong things...I don't see how it
> can help.

For us, these are not the wrong things, these are the things we want people to
think about. In most OO programming applications you want to free people to
think at a higher level, we do not. In fact we seldom even use objects and
inheritance, because we prefer to keep things at a lower level than that.

-- 
Tek
www.evilsuperbrain.com


Post a reply to this message

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