set and class

Discussion in 'C++' started by DBC User, Apr 15, 2007.

  1. DBC User

    DBC User Guest

    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.
    DBC User, Apr 15, 2007
    #1
    1. Advertising

  2. Obnoxious User, Apr 15, 2007
    #2
    1. Advertising

  3. 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
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=, Apr 15, 2007
    #3
  4. 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]
    Scott McPhillips [MVP], Apr 15, 2007
    #4
  5. DBC User

    osmium Guest

    "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.
    osmium, Apr 15, 2007
    #5
  6. DBC User

    James Kanze Guest

    On Apr 15, 8:56 pm, "osmium" <> wrote:
    > "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:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Apr 15, 2007
    #6
  7. DBC User

    osmium Guest

    "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/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.
    osmium, Apr 16, 2007
    #7
  8. DBC User

    osmium Guest

    "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/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.


    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. :-(
    osmium, Apr 16, 2007
    #8
  9. DBC User

    James Kanze Guest

    On Apr 16, 1:11 am, "osmium" <> wrote:
    > "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/serendipity/index.php?/archives/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:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Apr 16, 2007
    #9
  10. DBC User

    James Kanze Guest

    On Apr 16, 3:41 am, "osmium" <> wrote:
    > "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:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Apr 16, 2007
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. keith edward
    Replies:
    1
    Views:
    384
    John C. Bollinger
    Apr 8, 2004
  2. E11
    Replies:
    1
    Views:
    4,683
    Thomas Weidenfeller
    Oct 12, 2005
  3. jd
    Replies:
    3
    Views:
    333
  4. christopher diggins
    Replies:
    16
    Views:
    722
    Pete Becker
    May 4, 2005
  5. Joseph Turian
    Replies:
    5
    Views:
    563
Loading...

Share This Page