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

RE: "static" declaration



Reginald Braithwaite-Lee wrote:
> using class extension to create type hierarchies. And thus, the Java
> culture, from Sun's own libraries on down, is to use classes to create
> types.
>
> And for me, this is the most important issue of a language: not what it
> makes possible, not what its designers and implementors intend, but how
> it gets used "in the wild."

I agree, although I find in practice the case with Java is fairly good.  I
somewhat disagree with this:

> And so with Java, it is possible to develop "less inelegantly,"
> however it is not straightforward to work around its heavyweight
> implementation/typing hierarchy and most Java programmers are
> blissfully unaware of why you might want to do so.

I've found that because interfaces tend to be quite central to the design of
most popular Java libraries and tools, even developers who may not have been
exposed to anything formal about why and how they should use interfaces,
will have picked up at least some of that mindset, by example.  The concept
is easily described to a Java programmer, and it doesn't usually meet with
much resistance.  So while there may be Java programmers out there who are
blissfully unaware of this and don't write code that way, the ones I work
with don't fall into that category, and that's what matters to me...  :)

As an example of a language that has a facility like this that is underused
in real code, I'd pick C++.  You can define interfaces in C++, as pure
abstract classes, and many libraries do make use of this.  But code in the
wild often doesn't do this, partly I'm sure simply because the distinction
between type and implementation is not as clearly drawn syntactically.
(Another reason is that template use tends to promote a completely different
design approach in many systems.)

I'm not trying to argue that Java is lightweight, though.  I simply wanted
to clarify the point about Java's support for truly abstract types, because
I think that's actually one of its stronger points.

Anton