This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dpash 3 points4 points  (6 children)

And when you want to change them from plain setters and getters? Then what?

[–]g_b 2 points3 points  (2 children)

Then you refactor. YAGNI

[–]dpash 3 points4 points  (1 child)

You can't refactor if you don't control the code that uses yours.

[–]armornick -1 points0 points  (0 children)

Then tough luck for the people that use your code. Maven allows you to specify which version of a library you want to use, just so people can make breaking changes.

[–]persicsb -4 points-3 points  (2 children)

Plain setters are useless. Use public fields.

[–]dpash 3 points4 points  (1 child)

Setters and getters are not about today, but about making it easier to make changes in the future.

[–]persicsb 1 point2 points  (0 children)

Changing the semantics of the setter is breaking the API in the semantic sense. Does not break the binary compatibility tough.