POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Day 6 Server Time
29 Jul 2024 16:25:25 EDT (-0400)
  Re: Day 6  
From: Le Forgeron
Date: 18 Apr 2012 02:24:08
Message: <4f8e5e08$1@news.povray.org>
Le 17/04/2012 14:13, Invisible a écrit :
> Obviously this /isn't/ what's so special about classes. The /actual/
> benefits don't appear to be mentioned.

The benefit of class over a simple struct/collection is in the
private/protected parts, and the mandatory centralisation of the
prototypes of all related functions (until you start playing with
friend, but that's another story).

The point in class is to separate the interface (how the outside world
see me and use me) from the implementation (how I do it internally).

Once exposed, the public interface must remain (it can be expanded, but
not changed drastically).
The implementation can be changed at any time.

And then we are going to enter some holy wars about automatic getter &
setter, and static member in class.


-- 
A good Manager will take you
through the forest, no mater what.
A Leader will take time to climb on a
Tree and say 'This is the wrong forest'.


Post a reply to this message

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