[Tutor] Follow up to 'class data'

alan.gauld@bt.com alan.gauld@bt.com
Tue, 4 Dec 2001 10:55:03 -0000


> Well, classes "hide" data so that it's harder to mess it up 
> The fancy name for this is data incapsulation, I think. 

Actually its 'data hiding'. 
Encapsulation is the process of combining data and function into
a single blob - an object. There are many OO languages which 
implement encapsulation without data hiding - early Python 
being one!(and still does by default).

Unfortunately even many modern books have gotten these 
terms mixed up which is an unfortunate side effect of 
the industry's confusion between OOP and C++!

> Now OO gurus will have a heart attack because I like classes 
> for all the wrong reasons ;-P.

Sounds like exactly the right reasons to me!
Of course those advantages pave the way for other exciting
features like asbstract classes etc too, but they are a 
consequence of the fundamental features you describe.

Alan G