Is defining get/set methods for every field overkill?

thebluepandabear therealbluepandabear at protonmail.com
Sat Nov 19 03:58:06 UTC 2022


A better example of a code refactor after adding getters/setters 
is changing the names of the fields like so:

```
class Rect2D {
     int _width;
     int _height;
```

or

```
class Rect2D {
     int width_;
     int height_;
```




More information about the Digitalmars-d-learn mailing list