--> Kevin Sheetz wrote to All <--
KS>What the heck is object orientated programing?
KS>Can anyone explain in English?
The answer to the second question is no. :-)
It's not easy to give a totally satisfactory answer without using some
new terms that seem confusing. I will try to give you a short and
understandable, but by no means complete, answer.
Any system can be viewed either by looking at the things involved or the
processes involved. Procedural languages and design (for instance using
C) concentrate on the processes and algorithms. A collection of
functions is created to perform various operations.
In object oriented programming, the things themselves are of interest.
These are the objects. An object is just some entity that has well
defined behavior. Objects do things when one of their member functions
is called.
Object oriented programming deals with the behavior and interaction of
objects. New objects can contain other objects or inherit directly the
features of other objects.
Here's a simple example of the difference between OOP and procedural
languages. I won't discuss the mechanisms involved, but will just tell
you what happens.
Suppose you are writing a program that needs to display objects of
different shapes on the screen. In a procedural language you would write
a routine to draw a line, a circle, an oval, a rectangle, etc. Then to
display say, a circle, you would call the circle routine with the
correct center and radius. To display a rectangle, you call the
rectangle routine with the correct parameters.
In an OOP drawing program, you would have a base object, call it Figure,
from which objects for the various shapes would be derived. To display
the proper shape on the display, you might only need to call the Draw()
member function of Figure. Figure->Draw(); The object knows what shape
it is and how to draw itself!
So, instead of calling a particular procedure to display a certain
shape, you tell a shape object to draw itself. The result is you can
pass around shapes without having to worry about any particular one--the
object knows what type it is.
KS>What the heck is the differnce between C and C++?
C is a procedural language. You write applications by creating a number
of functions to do certain operations on data.
C++ is an enhanced C with many new capabilities that support object
oriented programming. In specific terms, C++ supports classes,
encapsulation, polymorphism, inheritance, data abstraction, overloading,
and other OOP goodies.
X CMPQwk 1.42 1692 X"Every definition is dangerous." - Erasmus
--- Maximus/2 3.01
---------------
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
|