BLM> "Object Oriented Programming" is mostly hype first of all.
Well, there certainly is a lot of hype presented about OOP. But I
find a lot of use for OO techniques. I've found that OOP is especially
useful for *large*, multi-programmer projects.
BLM> I have
BLM> never seen a clear definition of object oriented programming. If it
BLM> was a tangible thing I think somebody would be able to provide a
BLM> basic description of it.
It's a pretty complex subject. There are some decent tutorials in the
book stores. There are some especially good books that use C++ as their
example language when discussing OO ideas.
BLM> As far as I can tell it is simply a way of
BLM> protecting data by making sure that only code within an "object" can
BLM> access the data that is within the same "object".
That's "encapsulation". One of the advantages to using a language that
supports OOP is built-in support for encapsulation. "Good C programmers"
have been doing it for years. But C++ let's you do it a whole lot easier
and a whole lot more effectively.
BLM> I'm sure there are
BLM> other features that I'm missing
The other two "major" features of OOP are "polymorphism" and
"inheritance". If you're interested we can discuss them in some
future message.
BLM> but as nobody seems willing to
BLM> volunteer anything other than, "What's object oriented programming?
BLM> That's a very complex question."
Well, it *IS* a complex question!!
BLM> Classes are the basic building blocks of C++ programs just as
BLM> functions are the basic building blocks of C programs.
BLM> Classes are just like structs EXCEPT classes can contain code as well
BLM> as data.
BLM> You can de/allocate classes just as you can de/allocate structs.
BLM> If you understand classes, you understand alot of C++.
It looks like you've got encapsulation down! But we can do some neat
things with those classes. We can derive new classes and inherit
base class behavior. (Maybe we won't have to rewrite so much code!!)
We can design systems that can accept a variety of objects, maybe even
objects we don't yet know exist.
There's a whole lot more to OOP than simply restricting access to
an objects methods and data.
---
þ Blue Wave/QWK v2.12 þ
---------------
* Origin: St. Louis Users Group (1:100/4)
|