[Prev][Next][Index][Thread]

Re: MI: why?



rob myers <mac_gwydion@yahoo.com> wrote in message
20000112214133.27101.qmail@web3301.mail.yahoo.com">news:20000112214133.27101.qmail@web3301.mail.yahoo.com...
> Classes as a concept don't have to contain methods,
> and indeed even in C++ you can view a virtual method
> as an entity that stretches down through the class
> hierachy.

This was the biggest switch I had to make in thinking about
object-orientation when switching to Dylan.  I had beforehand -- because of
pollution caused by C++, Java, Eiffel, etc. -- always conflated the mostly
orthogonal issues of state encapsulation, access control and functionality
encapsulation into one "golden hammer" solution: classes.  It took looking
into Dylan, Modula-3 (to an extent) and other such languages for me to even
realize that an alternative viewpoint was available.

Now, post-Dylan-switch, I map these concepts into different containers.
State encapsulation belongs to classes.  Access control belongs to libraries
and modules.  Functionality encapsulation belongs to generic methods.  I
find myself wrestling with the language less and the problem domain more
now.  This, combined with access to some of the cool features of functional
programming (not to mention the ability to effectively add new semantics to
the language with hygenic macros) has confirmed my selection.

Of course now I can't convince any of my colleagues of the benefits of this
switch.  They see methods without a "self" or "this" (implied or explicit)
and the barriers snap up.  "That's not object-oriented programming!" is the
endless refrain.

> MI can save time and effort, make elegant designs
> or be mis-used like anything else. :-)

There is *no* language feature in *any* programming language which cannot be
perverted to the cause of Evil.  Yes, that includes "if" statements....  :-)

--
Michael T. Richter    <mtr@ottawa.com>    http://www.igs.net/~mtr/
"get a life. its a plastic box with wires in it."
-- Nadia Mizner <nadiam@onthenet.com.au> (in private correspondence)




References: