POV-Ray : Newsgroups : povray.off-topic : Visual C# .net (and XNA) first impressions : Re: Visual C# .net (and XNA) first impressions Server Time
5 Sep 2024 09:23:31 EDT (-0400)
  Re: Visual C# .net (and XNA) first impressions  
From: Darren New
Date: 12 Oct 2009 16:19:21
Message: <4ad38f49$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Sure. But people are discussing .h files, where there's no such option in 
>> C++. In C, you could make the function static, but that's not the same thing 
>> for a C++ method.
> 
>   How would you suggest having support for implementing private functions for
> a class without having to declare them in the class declaration *and* without
> opening the private parts of the class to any external code that wishes to
> access it?

I don't know. C# does it by not having header files.  I'm not saying C++'s 
solution is a bad one per se.  (*I* don't like it as much, but that doesn't 
mean it's *bad* universally.)

I'm merely pointing out that it's hypocritical to claim that it's better to 
*have* to maintain something manually because then you're not dependent on a 
tool to maintain it.

>   The solution to this is to specify the private functions in the class
> declaration.

Or not have class declarations at all.  If you define it private, then it's 
private. You don't need to declare it at all, public or private.

>   If you don't care about privacy, then put everything in the public section
> of the class and write all the formerly private functions in a nameless
> namespace inside the source file.

That doesn't work for instance methods, does it?  An instance method 
actually has to be a member of the class in the class declaration, yes? (I'm 
just double-checking I understand that part.)

-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

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