This post originated from an RSS feed registered with Java Buzz
by Weiqi Gao.
Original Post: It Looks Like I'm Not Alone
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Both of the above, like mine, are non-proposals from non-language designers. And like mine, both appeals to the C function pointer syntax.
I understand that the C function pointer syntax is a little bit foreign to the non-C/C++ Java programmers. I still believe C function pointer syntax based Java closures syntax will mesh well with the rest of Java syntax.
For another reference point, here's the syntax for one of the C++ closure proposals:
tr1::function<int(bool)> A::f2 = int(bool b) { return b ? 1 : 2; };
Of course, for designers of the Java closure fetures, (I imagine) the syntax is the least important aspect of the design. Just like for those of us who writes GUI applications, we are not thinking about how good the screens are laid out when we are concentrating on the internals.
However, when they show their design to us, the syntax is the first thing that we have to get used to. Just like when we show a half baked GUI application to our users, the first thing they see is how ugly the screens are.
We are focusing on the syntax because that's all we see. And if my analogy can be carried a little further, the language designers don't usually know what's the best syntax for the feature. Just like the programmer usually design the ugliest GUIs.