JDK 8 and properties

Paul Benedict pbenedict at apache.org
Wed Oct 5 09:11:05 PDT 2011


Here's my opinion... Properties brings its own issues. Part of Java's
success is the readability of the language. If the dot notation is
used for properties, readability diminishes because it is no longer
apparent whether field access or method access is occuring.

someObject.x = 1; // method call or field access?

If another syntax is used, then I think it almost defeats the purpose
of the proposal in the first place; it also begs the question how is
that any "better" than simply calling the getter/setter directly.

Paul


On Wed, Oct 5, 2011 at 11:05 AM, Loic Descotte <loic.descotte at gmail.com> wrote:
> About Alex Miller answer,
>
> The consensus was not there at the beggining for lambdas, but it worked
> (even if it was hard, I admit)
>
> For the second point, I work on server side but properties are important to
> me :)
> And a lot of people I know feel the same.
>
> On Wed, Oct 5, 2011 at 5:26 PM, Mark Thornton <mthornton at optrak.com> wrote:
>
>> On 05/10/11 16:15, Loic Descotte wrote:
>> > Hi all,
>> >
>> > I was wondering if coin 2 (in JDK 8) would possibly include a
>> "properties"
>> > feature, to avoid writing getters and setters for all fields in our
>> classes.
>> >
>> >
>> The second answer (from Alex Miller) probably still applies
>>
>>
>> http://stackoverflow.com/questions/710266/why-will-there-be-no-native-properties-in-java-7
>>
>> Mark Thornton
>>
>>
>>
>>
>
>
> --
> Loïc Descotte
> 4 rue Joseph Fourier
> 38000 Grenoble
>
> 06 23 23 36 80
>
>



More information about the coin-dev mailing list