In article <11**********************@g47g2000cwa.googlegroups .com>,
arganx <ar*******@yahoo.com> wrote:
I'm new. All of my books when talking about classes always use some
sort of "database" example, e.g. tracking stock, tracking baseball
stats, etc.
I'm trying to think OOP and wonder is there are uses for classes for ME
to use within my program. In other words a class of ? to help me to do
?. I can't see that this would be different than a function, or am I
completely missing it.
Any comments, ideas or short examples would be appreciated.
In many cases you actually _do_ just want a function.
Note that that focuses often on solely an perspective
that is algorithmic, simple, and perhaps only a uni-operation.
Classes tend to focus on types, subsystems, and relationships
up and down related types, along with their usually
multiple operations. The question isn't solely just
can't I just use functions to code up my problems,
because obviously computer languages have been around
for a while, and people have been able to provide fairly
elaborate applications even though those lanuages did not
directly support OOP. The issue is more of how we can break
down problems, spell out the interaction and operations
which need to occur, and best design and model the task at hand.
Unfortunately, we cannot do your question justice in a NG, however,
I know you express what many folks wonder, and go through.
For well thought out ideas, etc I would suggest getting
the below two books in addition to your current ones.
I would get Stroustrup's The C++ Programming Language
(3rd or special edition) and have a look at Chapter 2, 1,
23, 24, 25. These are issues pretty much never ever discussed
in many so-called beginner [C++] books, and yet they are
exactly about what most of it's all about. It's ok if
you don't get everything on your first read because you
will have this book for a long time. Better yet, get
two copies and wallpaper the room with it.
Similarly, get Koenig and Moo's Accelerated C++. It tends
to reverse the normal introductory progression from the
random low-level hen-pecking solutions looking for problems
approach and throws you right into what it's all about
such as abstraction, problem solving, class design, etc.
These two texts are authoritative, to the point, insightful,
and then some. Neither is particularly an easy read for
everybody, however, they are spot on where you need to be.
See
http://www.comeaucomputing.com/booklist for isbn info, etc.
--
Greg Comeau / Celebrating 20 years of Comeauity!
Comeau C/C++ ONLINE ==>
http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?