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

Re: accumulator generator (Java)



Anton van Straaten wrote:
> 
>...
> 
> I don't know exactly what PaulG had in mind, but the benchmark does clearly
> illustrate how well a language can define closure or object-like constructs
> "inline", without separate definitions.  Even with Java's ability to create
> anonymous inner classes, a separate definition of an appropriate interface
> or class would be required.  This makes Java more verbose, in cases like
> this, than languages which support independent inline creation of this kind
> of construct.  That's a valid test.

It isn't a test of "power". Java is a statically typed programming
language. Presumably you chose it because you think that those separate
definitions are useful. Java programmeres would say that their language
is more powerful (or at least more useful) because it requires those
definitions. I don't happen to agree with them but I can nevertheless
see their point of view.

Similarly, Python is an object oriented language. Presumably you chose
it because when you want to encapsulate some mutable state with some
behaviour you are willing to create an object.

Now if you showed a circumstance (and there are many) where hundreds of
lines of hard-to-read, hard-to-maintain Java collapse into a few lines
in a dynamically typed programming language then even a Java programmer
would probably admit that they've traded some expressive power for their
safety.

 Paul Prescod