|
Re: What Features Would You Remove from Java?
|
Posted: Jun 7, 2007 6:22 PM
|
|
> Yes it was to ease the implementation of the inner class. > I read that they considered this but it would require > e allocating the methods variable on the heap and that was > rejected, I believe because of performance concerns. > Maybe those concerns are no longer applicable.
The closure proposals, C3S, CICE, FCM, and BGGA, allow write access to local variables. With CICE the variable is marked public, with the others no new syntax. All the proposals box the variables that you write to, much like autoboxing of primitives.
Sun did consider autoboxing; but there was a strong negative reaction to autoboxing at the time, so they didn't do it. I don't think it is hard to do so it wasn't to make their life easier, it was considered that people would prefer the no autoboxing and explicit declaration option. They have a reasonable point, look at the reaction against autoboxing of primitives.
Personally I declare almost all variables final, I write in a functional style, therefore I don't have a problem with the restriction. However many people want this feature and this is the dilemma in introducing new features. You have:
1. People who want autoboxing removed
2. People who want more autoboxing
3. People who want the autoboxing they currently have removed and a new form added
It is therefore hard to satisfy everyone.
|
|