lua-users home
lua-l archive

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

On Mon, Jan 17, 2005 at 04:46:32PM +0100, Klaus Ripke wrote:
> On Monday 17 January 2005 16:03, Jamie Webb wrote:
> > That seems like a pretty legitimate use (and the only one
> > I've noticed) but as usual it's only because Java is so braindead.
> It's a very backward way to have the thingy kind of declared,
> just because it needs to be declared.

No more so I think than giving functions formal parameters.

> Consequently, you see dummy implementations of such methods throw
> UnsupportedOperationException or the like as in non-modifiable iterators,

That's more a consequence of Java's lack of type inference than
anything else I think. The designers thought breaking out all the
properties of collections into separate interfaces would be too
confusing for Joe Programmer. There's no reason in the language why it
couldn't be done.

> as to showcase how futile the whole we-force-you-to-do-it-right approach is.

I'm actually quite a fan of static typing. It lets the compiler be far
more 'helpful'. Trouble is, the type system needs to be sufficiently
flexible that you can use it rather than fighting it. Java's is way
too simplistic. Sophisticated type systems like those of Cecil, Nice,
or O'Haskell can provide good guarantees about the behaviour of code
without restricting the way it is structured. Trouble is, to be that
flexible they have to be damnably complicated, and so those languages
never made it out of academia (well, Nice might yet; a shame it uses
the JVM...).

-- Jamie Webb