algorithms and ADTs (was Re: efficient idiomatic queue?)

Mitch Chapman Mitch.Chapman at bioreason.com
Wed Jan 16 11:41:56 EST 2002


Andrew Dalke wrote:
> 
> Aahz Maruch wrote:
> >Um, what's an ADT?
> 
> "abstract data type"
> 
> It's a data structure with associated methods (wasn't called
> class nor object 20+ years ago) which can be used unchanged
> in many different codes.

As Andrew hinted, a big distinction between OO classes 
and ADTs is that the latter can't be subclassed.

ADT-based programming is useful in languages which don't 
directly support OOP (e.g ANSI C).  They don't provide subclassing 
or protocol/interface-based programming, but ADTs do 
simplify encapsulation and memory management.

My first exposure to ADTs came when I started using
Modula-2.  Hence the claim that if you remove memory-management
(i.e. instantiation) from ADT-based programming you get 
module-based programming :)

-- 
...and lots of singletons

Mitch Chapman
Mitch.Chapman at bioreason.com



More information about the Python-list mailing list