473,666 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

set and class

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.

Apr 15 '07 #1
9 1562
DBC User skrev:
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.
http://en.wikipedia.org/wiki/Class_%...ter_science%29
http://en.wikipedia.org/wiki/Set

--
OU
Apr 15 '07 #2
On 2007-04-15 20:13, DBC User wrote:
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.

--
Erik Wikström
Apr 15 '07 #3
DBC User wrote:
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.

--
Scott McPhillips [VC++ MVP]

Apr 15 '07 #4
"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 simulaThere 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.
Apr 15 '07 #5
On Apr 15, 8:56 pm, "osmium" <r124c4u...@com cast.netwrote:
"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.
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.)

--
James Kanze (Gabi Software) email: ja*********@gma il.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Apr 15 '07 #6
"James Kanze" wrote:
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/serendip...erm-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.
Apr 15 '07 #7
"osmium" weites:
"James Kanze" wrote:
>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/serendip...erm-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.
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. :-(
Apr 16 '07 #8
On Apr 16, 1:11 am, "osmium" <r124c4u...@com cast.netwrote:
"James Kanze" wrote:
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/serendip...ives/70-The-or...
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, [...]".
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.
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.
(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.
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.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Apr 16 '07 #9
On Apr 16, 3:41 am, "osmium" <r124c4u...@com cast.netwrote:
"osmium" weites:
"James Kanze" wrote:
[...]
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).

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Apr 16 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9592
by: Fernando Rodriguez | last post by:
Hi, I need to traverse the methods defined in a class and its superclasses. This is the code I'm using: # An instance of class B should be able to check all the methods defined in B #and A, while an instance of class C should be able to check all methods #defined in C, B and A. #------------------------------------------------
18
6945
by: John M. Gabriele | last post by:
I've done some C++ and Java in the past, and have recently learned a fair amount of Python. One thing I still really don't get though is the difference between class methods and instance methods. I guess I'll try to narrow it down to a few specific questions, but any further input offered on the subject is greatly appreciated: 1. Are all of my class's methods supposed to take 'self' as their first arg? 2. Am I then supposed to call...
1
3335
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me to turn a previously made String class that deals with char's into a templated String class that uses the template parameter C instead of char. I thought it would be fairly simple to do this exercise, but I encoutered many errors for my...
13
2370
by: Bryan Parkoff | last post by:
I have created three classes according to my own design. First class is called CMain. It is the Top Class. Second class and third class are called CMemory and CMPU. They are the sub-classes. Two sub-classes have the relationship to communicate back and forth through this pointer. The pointer is responsible inside Top class for allocating and deallocating two sub-classes. CMemory class is responsible to allocate and deallocate memory...
9
4989
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class pointer which points to an instance of a derived class, but when I pass that base class pointer into a function, it can't access the derived object's public functions. Although, the base class pointer does call the appropriate virtual function...
8
2851
by: Bryan Parkoff | last post by:
I find an interesting issue that one base class has only one copy for each derived class. It looks like that one base class will be copied into three base classes while derived class from base class is executed. It means that three derived classes are pointed to a separated copy of base class. I do not allow second and third copy of base class to be created, but it must remain only first copy of base class. It allows three derived...
21
4064
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class A { std::vector<B*> Bs; public:
5
3153
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits CommonPageBase - Contains myPage which inherits PageBase Each of these classes overrides OnInit and ties an event handler
3
3749
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and thawed it out. I built a console app using Microsoft Visual C++ 6 (VC++) and it worked great. Only one line in the header file had to be commented out. I built a console app using Borland C++ Builder 5. The linker complained of references to...
0
2822
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass magic, I wrote the following module. It is mainly useful as a light weight tool to help programmers catch mistakes at definition time (e.g., forgetting to implement a method required by the given interface). This is handy when unit tests or...
0
8355
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6191
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.