set and class

D

DBC User

I am trying to find the difference between set and class. Could some
one help me? I can understand that a class is like a set. Each subset
could be a inherited class and members are instances. What is the
difference between class and set and if there is any?
Thanks.
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

I am trying to find the difference between set and class. Could some
one help me? I can understand that a class is like a set. Each subset
could be a inherited class and members are instances. What is the
difference between class and set and if there is any?

A set is a collection of something and usually it is required that each
member of the set is unique in the set (no doublets). A class (as we
talk about here) is a construct in a programming language. Members are
not instances of classes, objects are. When using inheritance the
derived class is not a subset but rather a superset since it will be at
least what the base class was and probably more.

Since you don't seem to have a good understanding of object oriented
programming, (in fact you seem to have misunderstood the basics) I'd
recommend that you find yourself a good book on the subject, since it
can be quite trick in the beginning. There are some that deal purely
with object oriented design and others that combine object oriented
design together with programming, which one you need depends on you goals.
 
S

Scott McPhillips [MVP]

DBC said:
I am trying to find the difference between set and class. Could some
one help me? I can understand that a class is like a set. Each subset
could be a inherited class and members are instances. What is the
difference between class and set and if there is any?
Thanks.

A C++ class is something that you custom design. You can design many
things (members) into it and they can be of many types. You can also
put your own methods into it. It is a fundamental element of the C++
language.

A set is merely a predesigned container for objects, and all of the
objects in a particular set must be of the same type. It is a utility
class provided with the standard library.
 
O

osmium

"DBC User" wrties:
I am trying to find the difference between set and class. Could some
one help me? I can understand that a class is like a set. Each subset
could be a inherited class and members are instances. What is the
difference between class and set and if there is any?

I don't think class is a very good term to describe that thing as used in
the computing field - so it's natural to have problems with it. But I don't
know of a much better word, template is about the best I can do. Skeleton?
Apparently the people who coined the term didn't like it too much either.
Note that their native language was Norwegian, but I don't mean to imply
that that was a factor. I knew the first usage goes back to at least Simula
67 so I used this search target on Wikipedia.
<class etymology . class OR classes simula> There are several hits but I
didn't see any that seemed likely to really impress me so I only looked at
the first hit. Here is a link to it. If you want to pursue it that search
target should be useful. Note that Hoare is mentioned, that would be, I
think C A R Hoare who is famous for his contributions to the field of
computing.
 
J

James Kanze

"DBC User" wrties:
I don't think class is a very good term to describe that thing as used in
the computing field - so it's natural to have problems with it.

As a general rule, no everyday English word will really fit when
describing something as abstract or as precise as the elements
we use in computing. So we make do.
But I don't
know of a much better word, template is about the best I can do.

A C++ class certainly has nothing to do with what I would
understand under the everyday English word template.
Skeleton?
Neither.

Apparently the people who coined the term didn't like it too much either.

What makes you say that?
Note that their native language was Norwegian, but I don't mean to imply
that that was a factor. I knew the first usage goes back to at least Simula
67 so I used this search target on Wikipedia.

It's also the term used in Smalltalk (whose author invented the
name "object oriented"). It seems to have met with a great deal
of acceptance, very quickly.

(I also wouldn't waste my time with the Wikipedia for this.
It's not the most accurate of references.)
 
O

osmium

James Kanze said:
Apparently the people who coined the term didn't like it too much either.

What makes you say that?

I see I forgot to include the link. There was, however, a definitive
description of that link. It is

http://www.the-interweb.com/serendipity/index.php?/archives/70-The-origin-of-the-term-class.html

It includes this:

"Our good intentions have not quite worked out, however"

I used the simple minded technique of reading what they said on the subject.
Note that their native language was Norwegian, but I don't mean to imply
that was a factor. I knew the first usage goes back to at least Simula
67 so I used this search target on Wikipedia.

It's also the term used in Smalltalk (whose author invented the
name "object oriented"). It seems to have met with a great deal
of acceptance, very quickly.

Mantissa, WRT floating point was accreted quickly too.
What's your point??? Simula 67 was before Smalltalk.

(I also wouldn't waste my time with the Wikipedia for this.
It's not the most accurate of references.)

If you prefer tea leaves, be my guest. Or we could wander aimlessly in the
desert.
 
O

osmium

"osmium" weites:
What makes you say that?

I see I forgot to include the link. There was, however, a definitive
description of that link. It is

http://www.the-interweb.com/serendipity/index.php?/archives/70-The-origin-of-the-term-class.html

It includes this:

"Our good intentions have not quite worked out, however"

I used the simple minded technique of reading what they said on the
subject.


It's also the term used in Smalltalk (whose author invented the
name "object oriented"). It seems to have met with a great deal
of acceptance, very quickly.

Mantissa, WRT floating point was accreted quickly too.
What's your point??? Simula 67 was before Smalltalk.

(I also wouldn't waste my time with the Wikipedia for this.
It's not the most accurate of references.)

If you prefer tea leaves, be my guest. Or we could wander aimlessly in
the desert.

It turns out I was just defending Wikipedia on general principles. Actually
I used, and meant, Google. Unfortunately, I seem to use those two
interchgeably. :-(
 
J

James Kanze

I see I forgot to include the link. There was, however, a definitive
description of that link. It is

It includes this:
"Our good intentions have not quite worked out, however"
I used the simple minded technique of reading what they said
on the subject.

Remove the context, and you can make anyone say anything. The
following sentence makes it clear that it wasn't the word
"class" they were unhappy with, but the fact that "Many users
tend to use the term "class", or perhaps "class instance", to
denote an object, [...]".
Mantissa, WRT floating point was accreted quickly too.

And works well.

Don't forget, this is a highly specialized, technical
vocabulary.
What's your point??? Simula 67 was before Smalltalk.

It proves acceptance. Alan Kay was apparently happy with the
word.
If you prefer tea leaves, be my guest. Or we could wander
aimlessly in the desert.

Or we could use original and reliable sources. The Wikipedia is
often useful as a starting point (although it depends -- if
there's the slightest disagreement concerning the subject, it
generally only points to the opinions of whoever got there
last), but it's certainly not a source worth quoting.

BTW: you really should get another newsreader. Your citations
were completely wrong.
 
J

James Kanze

"osmium" weites:

[...]
It turns out I was just defending Wikipedia on general principles. Actually
I used, and meant, Google. Unfortunately, I seem to use those two
interchgeably. :-(

There's a big difference. Wikipedia gives you one persons
opinion. Google gives you everyone's opinion, and sometimes
some facts as well. Both have their uses, especially Google,
but you have to be careful with both.

If I want reliable information on this sort of thing, I'd go to
the ACM site, and look up the original articles (most of which
would have been published in the CACM).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top