Subject: re: object orientation

From: Mayer Goldberg <[email-masked]>
Date: Mon, 8 May 2000 22:05:17 +0300

>Define object-oriented.
>Not to encourage flamewars: Why isn't Java OO? Eiffel? Sather? Cecil?
>CLOS?
>
>It seems your defintion of OO is "being smalltalk"

I'm not familiar with Cecil, Sather and Eiffel, so I will suspend judgement on those. 
Java OO isn't built all the way into the type system, since int, char, byte, etc aren't 
objects. With the exception of Visual Age Java, Java systems aren't interactive and 
don't encourage the mark of true object orientation: Writing many classes and many 
*very small* methods, but rather a C-like style of programming. Interestingly, the 
JFC is written a style that couldn't be farther away from object orientation: Consider 
for example how numers and strings and chars are read from the console -- the way 
one "leaves" an integer mark to let the receiver "know" the type of the data read. If I 
had to imagine someone implementing IO in Fortran IV, this is how I would imagine it 
would be done. Another problem is that Throwables implemented so poorly, that 
they're practical only for exception handling rather than for general control flow 
management, and indeed, looking at the JFC it doesn't appear that anyone's using 
them for any other purpose. CLOS is much closer to being OO in my eyes, but even 
here, one cannot escape the feeling that it's built on top of what's an inherently 
non-OO system: *Ideally* in bootstrapping a CL development system (from the 
compiler and up) you would want to use CLOS to build the compiler. In fact, it's never 
done that way: CLOS is bureaucratic, inefficient and cumbersome, so CL systems 
are normally built procedurally and then CLOS is fitted on top. It's also conceptually 
inelegant: Objects are just one more thing in the Common LISP world. What makes 
Smalltalk so dramatically different is that 

- It's object oriented all the way down to the basic types.

- The basic ideas are few, simple, and clear. 

Smalltalk supercedes Scheme and LISP in abstraction power, since closures are just 
classless objects and their arguments are messages... This is the natural intuition for 
combining OO and functional programming. One language that took off on that 
intuition is Dylan. Dylan in fact has all the good things in Smalltalk, but is a bit more 
mature in terms of managing namespaces, types (optional), and efficient compilation.

So I guess I would say that I know two languages in which object orientation is not an 
add-on, not an extension, but an organic part: Smalltalk and Dylan.

One point worth noting is that the people that developed object orientation envisioned 
it as an interactive environment. While some people will insist on studying a language 
on the basis of its formal definition alone, they fail to notice, on account of this 
attitude, that object oriented languages were conceived to provide certain dynamic 
capabilities that are emptied of any meaning when one insists on a batch 
development environment. 

Mayer

---

From: Moshe Zadka <[email-masked]>
Date: Mon, 8 May 2000 22:16:54 +0300 (IDT)

> I'm not familiar with Cecil, Sather and Eiffel, so I will suspend judgement on those. 

I'm willing to give a Sather lecture too. I'll leave Cecil for someone
else, and Eiffel to neo-fascists.

> Java OO isn't built all the way into the type system, since int, char,
> byte, etc aren't objects.

Define "object".
("Must have methods" is not a good definition:

I assume you can have (in smalltalk, e.g.) the equivalent of

class foo {})

> [Java environments] don't encourage the mark of true object orientation:
> Writing many classes and many 
> *very small* methods, but rather a C-like style of programming.

"Encourage" is a subjective term. If you want to say Java programmers are
nincompoops, just say so.

> Another problem is that Throwables implemented so poorly, that 
> management

Surprise! That was the intent of throwables. If you want continuations,
you'll have to go for scheme. 

> Objects are just one more thing in the Common LISP world.

I'm afraid I've had a bit of a stutter: when I say CLOS, I mean
CLOS-like systems on scheme. In scheme, everything is an object. Not
everything is a class instance.

> What makes 

So is RScheme. There's nothing in R5RS that stops you from being OO all
the way down. 

> - The basic ideas are few, simple, and clear. 

What has that to do with OO?
 
> add-on, not an extension, but an organic part: Smalltalk and Dylan.

It is an add-on in Dylan, which started out as Lisp.

> capabilities that are emptied of any meaning when one insists on a batch 

Nothing about a language makes it impossible to use with interactive
environments. And the fact is, you still have not said in what way
Smalltalk is OO and CLOS isn't (take my weird meaning for CLOS: this
scheme hacker cannot stand the smell of common lisp)

--
Moshe Zadka <[email-masked]>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com