POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Day 6 Server Time
29 Jul 2024 10:18:31 EDT (-0400)
  Day 6  
From: Invisible
Date: 17 Apr 2012 08:13:21
Message: <4f8d5e61$1@news.povray.org>
"You make a new type by declaring a class."

Wrong.

"A class is just a collection of variables - often of different types - 
combined with a set of related functions."

It might be more accurate to say that an /object/ is a collection of 
variables. At any rate, "collection" usually means something more 
specific in this case.

"A class enables you to encapsulate, or bundle, these variables parts 
and various functions into one collection, which is called an object."

Where do I start?

I'm pretty sure "encapsulate" doesn't mean what you think it means. :-P

A "collection" usually refers to a group of objects, which isn't what 
you're talking about.

And finally, this is perhaps the most vague definition of an object I've 
ever heard. :-P

The next goes on to explain that classes are good because everything 
related to a thing is in one place. (Like you couldn't just write all 
the code together if it wasn't for classes.) Obviously this /isn't/ 
what's so special about classes. The /actual/ benefits don't appear to 
be mentioned.

I'm going to stop now, because otherwise I'll just go on forever... >_<


Post a reply to this message

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