News for hackers. Stuff that matters.
Re:Java: Missing Features by jonathankoren on Thursday November 26, 2015 @02:11AM (#10631705)
If there's no logic in the getter and setters, just make the properties public.
Re:Java: Missing Features by Retra on Thursday November 26, 2015 @02:20AM (#10631727)
That works until you want to add logic without breaking existing interfaces.
Re:Java: Missing Features by masklinn on Thursday November 26, 2015 @02:27AM (#10631752)
Or until you need to use them in beans and the like.
Re:Java: Missing Features by tajen on Thursday November 26, 2015 @02:45AM (#10631802)
Play!Framework 2 for Java is awesome in this matter. You write public members, but at compilation it transforms them into private members with getters and setters (if not final). It means if you write the setter, it overrides the default one.
Re:Java: Missing Features by kuschku on Thursday November 26, 2015 @02:51AM (#10631815)
Lombok does the same ;)
Re:Java: Missing Features by jinst8gmi on Thursday November 26, 2015 @04:30AM (#10632116)
But then you're using Lombok...
Re:Java: Missing Features by dfullarton on Thursday November 26, 2015 @07:32AM (#10632663)
Can you clarify? I've heard similar negative feelings from devs. What's wrong with lombok?
Re:Java: Missing Features by ossreality on Thursday November 26, 2015 @02:17AM (#10631720)
Huh? Then they're just fields and not properties, maybe I'm misunderstanding what you're trying to say. And there are numerous reasons that Properties are preferable to Fields.

Unless someone else can help me, I think this is really bad advice for a C# developer.

Re:Java: Missing Features by jonathankoren on Saturday November 28, 2015 @01:17AM (#10640233)
>Huh? Then they're just fields and not properties

Nomenclature schmomenclature.

They're variables with object scope.