replied to just now:
Are getters and setters on everything even considered a good practice? To me it screams junior developer who hasn’t yet fully understood encapsulation and abstraction — if you’re just exposing getters and setters as the interface then what is the class/module/etc providing beyond what a standard variable does…?
replied to:Getters and setters for everything. Certainly, if you want an object to be doing more than just getting and setting a value right now, get them in there! Planning to add functionality later without breaking code? Stop it! That should break code! If I'm consuming a library and have been using this setter method for 2 years, I don't want it to suddenly introduce brand new validation, caching, or logging behavior!