delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/21/05:30:21

From: Greg Moorer <gam3 AT ra DOT msstate DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: What is object orientated programming
Date: Thu, 20 Nov 1997 18:03:37 -0600
Organization: Mississippi State University
Lines: 26
Message-ID: <3474CFD9.487E@ra.msstate.edu>
References: <880060136 DOT 22763 DOT 0 DOT nnrp-03 DOT c2de5740 AT news DOT demon DOT co DOT uk>
NNTP-Posting-Host: port10-ts01.dialup.msstate.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> What is object orientated programming and in what way does it differ
> from normal C.
> 
Object Oriented Programming is a good thing...  after first learning OOP
in C++ and then having to go back to C for some Corps of Engineers work,
I am very much in favor of OOP.

At first glance OOP looks merely like creating structures that have
member functions in addition to the normal data members.  However, it is
really a lot more.  One thing that's great is inheritance [sp?]...  you
can create one class that encapsulates one form of object.  Then you
come in and create other classes that inherit the traits of that base
class and add more specific functions and data to describe a more
precise version of that object.  For instance you can create a door
object for a D&D style game, later you can come in and create new
objects that inherit the original door characteristics (Isitopen,
Isitstuck, etc.) such as a lockable door which has a new flag in it's
member data (Isitlocked).  

Another good thing is polymorphism...  this basicly involves controlling
which function will be called if an inherited class has an identicle
function name, but does something different than the class it is
inherited from.

Hope that helps,
-Greg

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019