Language Trickery

This guy, Andrew, has a nice post up: Language Trickery

Here’s my two cents..

Of course I’d love to see closures in Java. I think Sun is stupid like shit about not improving the language and only working on the API.

But hey, there is Groovy, right? And there have been ‘pre-compilers’ for Java before to add generics, closures, etc. Why aren’t they more popular?

Here’s my guess: With Java in the beginning it was all about being easier than C/C++ (think: for the masses..). But now, now it’s a lot about the IDE. Too much about the IDE probably.. And Groovy isn’t there yet.. It may have a better chance than Ruby to get there. But the really important thing is, imho, that you just don’t need that much IDE support when working with Ruby.

Anyway, what about the LoopObject Andrew made up. Of course, nothing beats a for-loop-syntax construct. But you can do a lot better with OO. How about using a builder-like syntax:

Loop.from( 10 ).to( 20 ).step( 2 ).do( new LoopBody() { .. } )

Looks pretty safe (and as nice as it can get) to me. Just a thought..

Well, to avoid misunderstandings: My favourite language right now is Ruby. (Unfortunately I ran into several corners with it concerning it’s bad performance in certain contexts. Nothing I can’t solve with some little C/C++ extensions. But that’s another topic.. :) I looked at Haskel, Ocaml, Scheme, Lisp, etc but I guess I’m not ready yet. Took me some time to get to Ruby. From Java, over Groovy and JRuby.. :)

The other day I read this. I think there’s some truth in there. Lisp and Scheme may be superior in many ways. But the ’syntax’ just stinks.. :)

Enough ranting for today. Time to enjoy the sun..

tfdj

No comments yet. Be the first.

Leave a reply