Monday, October 09, 2006

Like watching a puss-filled boil explode in slow motion

Reading this (which is only the latest in a long saga of closure debates on Java sites) makes me glad I don't program in Java anymore. I personally think it is too late to add closures to Java, simply because the existing libraries are not designed for it, but the responses posted in discussions such as these are so comical that I want to see closures added just so that these guys get pissed off.

Come on now enterprise monkeys, make up your mind: are closures simply for newbie "script kiddies" who are not man enough to use a 400$ keyboard macro IDE? Or are they so complex that newbies cannot learn them (nevermind the extremely convoluted anon inner class syntax). Or are they easy to learn but simply unsuitable for serious Enterprise(tm) team development?

This is sort of like watching assembly freaks debate if parameters should be passed in registers or on the stack... or if subroutine calls are any good at all. Those of us in the know have moved on long ago.

5 comments:

Anonymous said...

Are you kidding me... The title speaks of noob "Closures without Complexity"? Wtf! It doesn't get any less complex than closures...

Or maybe I'm as screwed up as you.

sohail

Anonymous said...

I'd like to continue spamming your blog. Waiting for some tests to finish.

I've actually been using closures in C++, if you can believe it. Using boost lambda and also creating function objects for simple interfaces.

I've actually had people say, wow, that is a really useful and obvious thing to do.

But these are guys with PhDs so take that with a grain of salt. I'm trying very hard to never introduce anyone to Java, ever.

PS: You're the man.

Anonymous said...

Pus, the slimy white stuff that oozes from infected areas, is spelled with only one 's'.

Puss is something totally different.

Anonymous said...

Hmmmmm, puss...

Ray Cromwell said...

I love how people dismiss closures without even knowing what they are...

"wha, I assume they're like C++ destructors. Java doesn't need them!"

And still more people dismiss them because they can type an extra 5 lines of boilerplate and achieve pseudo-closures.

The Java community has an inbuilt resistance to anything that reduces verbosity based on the idea that verbosity = readability. I think it started with the whole "operator overloading allows for confusing programs, see C++ abuse" and now anything that allows reduction in syntax tends to find resistance. Java philosophy was pitched against C++'s complex implicit promotion rules, and overloading. Thus, anything that seemed to be be a relaxation of philosophy is seen as a "slippery slope" to turn Java into C++, C++ fulfilling the role of Nazis ala Godwin's Law, since as soon as you can show something is similar to C++, it must be evil and bad.


* "Static imports? sqrt(15) is way less readable than java.util.Math.sqrt(15). How would you possibly know where the sqrt() function is defined!!"

* "Enum? I have typesafe enum pattern. Just saves typing thats all."

* "Varargs? Why do you need them, when with method overloading, you simulate them, and worse case, use use an inline array initializer"

* "Closures? I have anonymous inner classes. I don't see the point of saving a few lines of typing...Besides, I have macros to generate my 10 lines of boilerplate"
k