POV-Ray : Newsgroups : povray.off-topic : new C# stuff : Re: new C# stuff Server Time
6 Sep 2024 17:21:25 EDT (-0400)
  Re: new C# stuff  
From: Darren New
Date: 23 Jan 2009 23:55:47
Message: <497a9f53@news.povray.org>
Chambers wrote:
> In other words, you see no usefulness in having syntactic sugar.  I
> think it's useful.

Especially when you want to chain methods together to make things work.

Writing
   myCollection.Select(...).Group(...).Transform(...).Sort(...).Output()
is a lot more clear than
   Sort(Group(myCollection.Select(...)).Transform(...)).Output()
just like writing
   cout << 123 << endl << mystuff.xyz() << endl
is more clear than
   cout.write(cout.write(123).endl(), mystuff.xyz()).endl()
or something like that.

Plus, it interacts with other syntax of the language that the compiler turns 
into syntax like this. When your C++ sorting template has to know whether 
the right call is myThing.compare(otherThing) or 
MyUtil.compare(myThing,otherThing), it gets messy. That's exactly what this 
is for, so it's pretty much just like what operator overloading is for.

-- 
   Darren New, San Diego CA, USA (PST)
   "Ouch ouch ouch!"
   "What's wrong? Noodles too hot?"
   "No, I have Chopstick Tunnel Syndrome."


Post a reply to this message

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