This guy is a moron.
When he want's to introduce a getter later, he has to change all the uses of that variable and potentially breaking code of your customers if you're programming a library someone else uses.
I agree, it's a lot to type, but that's a mistake of the langauge.
In C# it would just be
public int TheData { get; set; }
You can use it like a normal variable.
You can later implement logic into the getter/setter without Breaking any code.
You can have a breakpoint in the getter/setter, which helps you to debug why and where the property unexpectedly gets changed.
0
15 Feb 2019 10:01
u/2340923408923409
in v/programming
This guy is a moron.
When he want's to introduce a getter later, he has to change all the uses of that variable and potentially breaking code of your customers if you're programming a library someone else uses.
I agree, it's a lot to type, but that's a mistake of the langauge.
In C# it would just be
You can use it like a normal variable.
You can later implement logic into the getter/setter without Breaking any code.
You can have a breakpoint in the getter/setter, which helps you to debug why and where the property unexpectedly gets changed.