|
|
>> If you consider "modular" to be a programming paradigm then... yes, I
>> guess.
>
> Yes, modular programming is usually considered a programming paradigm
> of its own (a type of precursor of object-oriented programming).
I thought that was structured programming?
> I think that the quintessential example of a modular programming
> language is Modula-2: Its modules are more or less full-fledged classes
> (public and private parts, member variables and functions, instanciation,
> references to such instances...), except for what would make it an
> object-oriented programming language: Inheritance.
I've heard legend of Modula-2. Never actually seen it though.
(Actually, I've heard legend of another functional language where
apparently modules *do* have inheritance... There are often debates
about whether Haskell should do this - with most people agreeing the
vast increase in complexity isn't worth it.)
>> (Does Pascal count as "module" too?)
>
> Pascal is a programming language, not a module. :P
Gah! The difference a few characters makes... :-S
[Obviously I meant "does Pascal count as modular?"]
>> Did I mention that Haskell also has "classes"? (Though they don't work
>> quite the same as in OOP.)
>
> If you can inherit and have dynamic binding (or a messaging system,
> ie. delegation) then it would more or less make it an OOP language,
> else it's just a modular programming language.
Dynamic binding? Sure. That's the entire purpose.
Inheritance? Mmm, not really, no.
[In Java, a class *is* a type. In Haskell, a class is something a type
may or may not be a member of. For example, the "Show" class provides a
"show" method. Any type that is a member of the Show class can be
converted into a string by calling the show function. It is possible to
make it so that no type can be a member of class X without first being a
member of class Y - but that's not exactly inheritance.]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|