I agree that anonymous classes are verbose. But any modern IDE will generate the anonymous class for you using autocomplete, so the amount of keystrokes in Java and C# ends up being very similar.
-
-
@Bass: You seem to be just as well-versed in Java apologetics as you are in JavaScript apologetics.

-
I'll take that as a compliment, I guess.
-
6 hours ago,Bass wrote
I agree that anonymous classes are verbose. But any modern IDE will generate the anonymous class for you using autocomplete, so the amount of keystrokes in Java and C# ends up being very similar.
I think bringing the IDE into the argument is a bit of a red herring. The fact remains that anonymous classes are not closures. Aside from the extra boilerplate, which I agree is not that much of a big deal, they're just not as versatile. The final variable requirement is just stupid.
-
17 hours ago,Ray7 wrote
*snip*
I think bringing the IDE into the argument is a bit of a red herring. The fact remains that anonymous classes are not closures. Aside from the extra boilerplate, which I agree is not that much of a big deal, they're just not as versatile. The final variable requirement is just stupid.
How it a red herring? I doubt people writing Java are using Notepad to code. The IDE indirectly fixes a lot of the language's deficiencies.
I never encountered a time where I was like "damn I wish I could write closures for mutable value types". So I don't find the final requirement to be a big deal.
Oracle intends to add "true closures" to Java 8, but I am not sure what that will accomplish other then complicating the language. If they really want to improve Java they'd let me disable checked exceptions somehow.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.