Strings in Switch
Lawrence Kesteloot
lk at teamten.com
Sun Dec 6 22:38:30 PST 2009
On Sun, Dec 6, 2009 at 10:17 PM, Reinier Zwitserloot
<reinier at zwitserloot.com> wrote:
> Let's no go closure crazy.
It's interesting that one of the arguments for closures is that it
makes language feature less necessary, but now suggesting that this
feature might be less necessary is "going closure crazy".
> The fact that switch does NOT support strings
> today is a silly triviality that catches out many beginning java
> programmers.
A triviality? Now every Java compiler has to support this, every IDE,
people have to learn it, people have to remember that it won't work if
their code might one day have to be compiled by JDK 6, etc. I don't
think anything in something as large as Java is a silly triviality.
Every feature has a non-trivial cost.
> A lot of the hard work on this proposal has already been done, so abandoning
> it now does not seem like a good idea.
That's 100% irrelevant. You don't add a feature to a language just
because the work has been done. If it's, on balance, not a worthwhile
features, then we remove it, sorry to those who spent time on it. Put
another way, if project coin would not today accept this feature in
light of closures, then it should pull it out.
> Also, Mark Reinhold's plan for closures does not include transparency, which
> would make a closure-based function map much inferior to strings in switch
> which is of course transparent.
Good point.
Lawrence
More information about the coin-dev
mailing list