Skip to content

Files

Latest commit

 

History

History
23 lines (16 loc) · 467 Bytes

use_setters_to_change_properties.md

File metadata and controls

23 lines (16 loc) · 467 Bytes

Pattern: Missing setter to change property

Issue: -

Description

DO use a setter for operations that conceptually change a property.

Example of incorrect code:

rectangle.setWidth(3);
button.setVisible(false);

Example of correct code:

rectangle.width = 3;
button.visible = false;

Further Reading