Why getters and setters are bad?

Getter and setter methods (also known as accessors) are dangerous for the same reason that public fields are dangerous: They provide external access to implementation details . What if you need to change the accessed field’s type? You also have to change the accessor’s return type.

Sizin İçin Seçtik  How do you take input from user in DART?

Leave a Reply

Your email address will not be published. Required fields are marked *