It seems that Elliotte really doesn't like Groovy or my work.
I'm not at all surprised to something
like this coming from Strachan, who's always been an advocate of the
more-is-more school of design.
This seems a bit harsh; you may dislike Groovy in favour of Java and
Python and prefer JDOM over dom4j (as you don't like interfaces) but
claiming all my work is more-is-more design is a little over the top
and not a very good statistical analysis - I've worked on many more
things than these 2 projects during my 23 years in IT. There are links
on the right of many more than these 2 public projects.
In my defence, take a look at ActiveCluster or ActiveSpace
and if you can come up with a useful abstraction which does similar
things with a simpler API I'm all ears - heck ActiveSpace has a simpler
API than JavaSpaces. (Who knows though, maybe Elliotte's right :)
Anyways I just wanted to comment on Elliotte's dislike for Groovy.
Firstly languages are all about style and esthetics and so they are
highly subjective. Its just not possible to create a language that
everyone likes - even that most people like, so folks are very welcome
to dislike Groovy. There are many languages I dislike too.
As an aside, it seems folks who like Python tend to be the biggest
critics of Groovy, yet folks who like Ruby (which I consider to be a
much cleaner & more beautiful OO language) really seem to like
Groovy and have similar dislikes of Python - for me its all those self
parameters and magic _underscore_ methods that put me off - though
there is much to like in Python (generators, tuples, slicing etc). It
seems once you find a language you like, you tend to dislike languages
which have different styles. Python has a very different style to other
languages like Ruby and Groovy and so I guess its totally
understandable. FWIW we've tried to keep some of the Java style so that
folks moving from Java to Groovy might like it.
Anyways back to Elliotte...
James Strachan has released beta 6 of
Groovy, a JVM hosted scripting language that strikes me as a little
baroque and a tad Perl-like. Not that the syntax lookes like Perl. It
just that Groovy looks like feature after feature has been glued on to
a foundation of sand. I don't feel an overall sense of design here.
There's no overarching vision for what a language should look like that
I can discern. There are lots of features to like in the language (and
quite a few to dislike: I'm sorry, but operator overloading is simply a
bad idea, as C++ proved once and for all; and we've known for at least
30 years that having both = and == in a language is a mistake; adding
=== to the mix doesn't help.); but even the features that do seem like
a good idea when considered individually don't feel like they fit
together. It just isn't as clean a language as Java or Python. :-(
Well there's not that much that I can argue about as much of the
criticism is about how he feels about the language & how he feels
it fits together rather than any concrete constructive criticism.
However I'd like to pick up on one apparent language feature Elliotte
doesn't like...
I'm sorry, but operator overloading is simply a bad idea, as C++ proved once and for all
The two languages that Elliotte claimed to be better, Java and Python
both support operator overloading - admittedly Java only
supports it in a very weak form. Pre-Java 5 only primitive types,
Strings, arrays and Object.toString() support some kind of operator
overloading. From Java 5 onwards with autoboxing you can use + / * and
so forth on the numeric classes too (apart from BigDecimal/BigInteger I
think). Though at least with Java you can't overload the behaviour of
the numerical operators or [], but you can only overload the toString()
method used when concatenating objects to a String. So really limited
overloading :)
If however you have a dynamically typed language and want to be able to
use concise expressions like + - * / [] and so forth you pretty much have
to support some kind of operator overloading. e.g. both Python and Ruby
do exactly this. So Groovy is hardly doing anything different here.
Groovy supports operator overloading in pretty much the same way as
both Python and Ruby. The major difference is that rather than using
magic underscore methods like Python for the container and numerical operator methods, we use relatively simple and straightforward method names some of which are already in the JDK today (equals, compareTo etc).
Look at the Python methods and the Groovy methods and which one seems
more perl-like? Notice that Python uses much more operator overloading
than Groovy. We've been very concious of becoming perl-like and so have
really kept operator overloading down to a bare minimum of the core
numerical and collection operators, so I'd say in the operator
overloading department we're less perl-like than Python.
Maybe its the term operator overloading that scares Elliotte - which I
understand - its quite scary in C++ and Python folks tend to not use the
term so maybe thats why he doesn't think Python suffers from the same
problem?
A couple more points that Elliotte raises...
we've known for at least 30 years that having both = and == in a language is a mistake
I'm sure it probably is but Java supports both of these tokens and
we're aiming Groovy at Java developers so we felt that using the same
tokens as Java for assignment and equality testing was a good idea.
Though in Groovy == is different than Java, it means equality, irrespective of whether the values are primitve types or objects and it handles nulls gracefully too.
One great point Elliotte makes is
adding === to the mix doesn't help
I agree that === is a bit smelly. None of us liked it at the time but
we needed a different token for identity. I confess to never having
used it yet either :). So its an edge case that folks rarely use - but
maybe we should use a keyword like is or identicalto?
if (x is y) { ... }
Finally
But if you're the sort of developer who
thinks Larry Wall is a more talented designer than James Gosling, maybe
you'll like Groovy too
Well, I'm in the James Gosling camp myself and I like Groovy so the two
are probably mutually exclusive. FWIW I hear James Gosling quite likes
Groovy too - the quote I heard was 'Groovy is groovy!'.
6:42:30 AM
|
|