u/2340923408923409 - Archived Voat Post in v/programming
u/2340923408923409
  • home
  • search

u/2340923408923409

0 posts · 1 comment · 1 total

Active in: v/programming (1)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: Getters/Setters are an Awful Programming Practice

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
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.