Re: What is OOP?

Liste des GroupesRevenir à cl c++ 
Sujet : Re: What is OOP?
De : wyniijj5 (at) *nospam* gmail.com (wij)
Groupes : comp.lang.c++
Date : 02. Dec 2024, 09:27:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <35400604257703c65dff9e04e001868077a86801.camel@gmail.com>
References : 1 2
User-Agent : Evolution 3.50.2 (3.50.2-1.fc39)
On Sun, 2024-12-01 at 20:11 -0800, Chris M. Thomasson wrote:
On 12/1/2024 9:17 AM, wij wrote:
There are several understandings:
https://www.quora.com/As-an-experienced-OOP-programmer-in-your-opinion-whats-the-biggest-problem-of-OOP-object-oriented-programming
 
...
OO can have many meaning. I took OO to mean object, the basic entity of the
programming model and the operation of the object. The concept, as foundmental,
has to be solid, practical and easily usable. Otherwise, more codes and efforts
will be needed latter to fix it, making the original goal ,practically, a lie.
IOW, (nearly) a flawless model is all the basics. ...
https://sourceforge.net/projects/cscall/files/MisFiles/ClassGuidelines.txt/download
[...]
 
struct object
{
     // [...]
 
     void do_it();
     void wink();
     void laugh();
     void pose();
};
 
 
? OOP right there in a sense?

NOPE.

Snippet from the classguidelines of libwy:
...
 Const member functions:
   A set of const function members, often referred to as property or attribute
   members, defines whether or not two objects function 'identically'. In
   general, a minimum set of such members must exist. These members are often
   in complexity O(1), and provide the basic proofs that the class is properly
   designed.
...

If there is no attribute members (const function member), how do we know whether
the class is properly designed or not? So, bascially, as long as default ctor
exists, there is a member 'bool is_default() const' to confirm it. The 2nd
question is how do we know whether the copy constructor does its job? Then,
there is a series of setters and getters... basically, verifiable by each other.
If you can make the function of these sets of members concise, efficient and
consistent, the concept of the class in your brain is probably right, otherwise
not right. This is the key point of libwy's OOP.

With your example (lacks ctors, but important), what is 'do_it()' and
others? You need some attribute members (getters) to confirm what those
non-const members do are exactly what they claim doing. So you also need other
attributes e.g. is_wink(), is_laugh() and is_pose(). Then, what the copy ctor
should do is clear. Then, assignment operator...,etc.
Whenever you have an idea, concept, try make it a 'complete' class (sometimes 
the idea does not fit as a class). Follow the basic rule, then, class design,
the program, will be lots easier and fun.



Date Sujet#  Auteur
1 Dec 24 * What is OOP?45wij
1 Dec 24 +* Re: What is OOP?2Ross Finlayson
1 Dec 24 i`- Re: What is OOP?1Ross Finlayson
1 Dec 24 +* Re: What is OOP?3Lynn McGuire
1 Dec 24 i+- Re: What is OOP?1Ross Finlayson
2 Dec 24 i`- Re: What is OOP?1Bonita Montero
1 Dec 24 +* Re: What is OOP?2Michael S
2 Dec 24 i`- Re: What is OOP?1wij
2 Dec 24 +* Re: What is OOP?6Richard Damon
2 Dec 24 i`* Re: What is OOP?5wij
2 Dec 24 i +- Re: What is OOP?1Richard Damon
8 Dec 24 i `* Re: What is OOP?3Isaac Ganoung
9 Dec 24 i  `* Re: What is OOP?2wij
9 Dec 24 i   `- Re: What is OOP?1wij
2 Dec 24 +* Re: What is OOP?3Chris M. Thomasson
2 Dec 24 i`* Re: What is OOP?2wij
3 Dec 24 i `- Re: What is OOP?1wij
2 Dec 24 +* Re: What is OOP?24Tim Rentsch
2 Dec 24 i+* Re: What is OOP?4Michael S
15 Dec 24 ii`* Re: What is OOP?3Tim Rentsch
15 Dec 24 ii `* Re: What is OOP?2Michael S
17 Dec 24 ii  `- Re: What is OOP?1Tim Rentsch
2 Dec 24 i+* Re: What is OOP?13wij
3 Dec 24 ii`* Re: What is OOP?12Chris M. Thomasson
3 Dec 24 ii +- Re: What is OOP?1wij
3 Dec 24 ii `* Re: What is OOP?10wij
3 Dec 24 ii  `* Re: What is OOP?9Chris M. Thomasson
4 Dec 24 ii   `* Re: What is OOP?8wij
7 Dec 24 ii    +* Re: What is OOP?3Chris M. Thomasson
7 Dec 24 ii    i`* Re: What is OOP?2wij
7 Dec 24 ii    i `- Re: What is OOP?1Ross Finlayson
20 Dec 24 ii    `* Re: What is OOP?4Chris M. Thomasson
20 Dec 24 ii     `* Re: What is OOP?3Chris M. Thomasson
20 Dec 24 ii      `* Re: What is OOP?2Chris M. Thomasson
24 Dec 24 ii       `- Re: What is OOP?1Chris M. Thomasson
7 Dec 24 i`* Re: What is OOP? --- The most important aspect of OOP6olcott
7 Dec 24 i +* Re: What is OOP? --- The most important aspect of OOP4Richard Damon
7 Dec 24 i i+- Re: What is OOP? --- The most important aspect of OOP1olcott
9 Dec 24 i i`* Re: What is OOP? --- The most important aspect of OOP2Tim Rentsch
10 Dec 24 i i `- Re: What is OOP? --- The most important aspect of OOP1Ross Finlayson
7 Dec 24 i `- Re: What is OOP? --- The most important aspect of OOP1wij
4 Dec 24 `* Re: What is OOP?4Rosario19
4 Dec 24  +- Re: What is OOP?1wij
18 Dec 24  `* Re: What is OOP?2Stefan Ram
19 Dec 24   `- Re: What is OOP?1wij

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal