Default said:
Whoop-de-do. It's a BIG difference.
No, it is not. Bjarne Stroustrup, The C++ Programming Language Spec. Ed.:
"By definition a struct is a class..."
Breaking here. Your sentences (see above) suggest to the poor newbie that
structs are *different* from classes. This is false information. The
creator of the language says otherwise:
"
By definition a struct is a class in which members are by default public;
that is,
struct s { ...
is simply a shorthand for
class s { public: ...
"
I'm not spreading false information, I'm expressing an opinion.
You are spreading the false information that classes are preferred over
struct. Struct *is* a class. Did you say "the use of the class keyword is
preferred over the use of the struct keyword when defining a class type in
C++" that would have been a completely different statement. And it would
even become "expressing of an opinion" had it been starting with IMHO, IMO,
"I think", "My opinion is" etc.
Newbies should not be using structs, with their default public
behavior.
You think...
They should be using classes, with default private,
You are still confused: structs are classes. You mean they should use the
class keyword for their class declarations instead of the struct keyword.
so they learn proper handling of member data.
I see. I do not believe that it will in any way help in that but I can
accept your opinion. (I do not believe because I have seen many people to
use C++, they did not know that they can use struct to define classes and
still all their members were public.)
The tendency for newbies is to use structs
just like C-style ones, with direct access
to the attributes.
You mean newbies coming from C. Since newbies using C++ will learn about
classes and struct and on the same page of a decent book they will learn
about not to make everything public.
That's not the way they should be starting out.
I have just too much bad experiences to say that it has nothing to do with
using the struct or the class keyword.
It's amazing how you can determine what I do and do not know. You
happen to be extraordinarily wrong.
Even in your reply you say _again_:
"Newbies should not be using structs... They should be using classes"
So what can you assume would this statement? That you are not aware of the
fact that types defined by the struct keyword *are* classes. Since you say
that instead of them newbies have to use classes. But they *are* classes.
Just admit you're still crying about that previous thread.
You saw what you thought was an opportunity to show me up.
Well, you was wrong bucko.
You should really need to that medication. You are getting worse.
I do not know why do you think that you are a bit important for me to
remember you or any thread of yours. When I reply in a thread I look at the
content of the post and not the poster. I suggest you start doing the same.
BTW start to get used to the fact that you are not that important or
extraordinary that people will just reply to your posts because you posted
them. At least I don't.