POV-Ray : Newsgroups : povray.off-topic : new C# stuff : Re: new C# stuff Server Time
6 Sep 2024 15:19:27 EDT (-0400)
  Re: new C# stuff  
From: Warp
Date: 22 Jan 2009 13:06:02
Message: <4978b58a@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> >   Basically, it seems, that instead of having to write, for example,
> > "someFunction(anObject)" you can write "anObject.someFunction()".

> Syntax sugar. And let lets you do things like
>    "Hello".toUpper().myConversion().trim("o")
> so you can chain them together.

> The same benefit you get in C++ from being able to make classes with no 
> virtual members.  You often talk about how you can have an array of points 
> in C++ without any extra overhead and still treat them like objects, yes? 
> Same sort of thing here.

  I'm not sure it's the same thing.

  The idea with having objects rather than raw data is that objects can
be made abstract, ie. have an abstract public interface which hides the
implementation).

  I don't see how "anObject.someFunction()" hides the implementation
better than "someFunction(anObject)", especially given that the former
does not add any access rights for the function in question (like
declaring a function as friend would).

-- 
                                                          - Warp


Post a reply to this message

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