generally agree, probably most devs nowadays do. otherwise there wouldn’t be stuff like @data in lombok.
i think the word ‘dogma’ is pretty good: it takes a good idea (encapsulation) too far. i am not old enough to have been coding when OOP was the new and hot stuff. but i imagine it comes from the idea that it is a good idea to protect private members where needed.
public class Account {
private Integer balance;
public Integer getBalance() {
return new Integer(balance);
}
}
that is not such a bad idea to protect balance from stupid sideeffects.
public String getName() {
return name;
}
is a nothing burger, as it returns the same reference and does not protect from accidental sideeffects.
i think my grandma put it quite simple: “never be the one to start punching people. but if you do get punched, make sure you hit them twice as hard”.
she never cared about gender and never really even mentioned it. and that in a time, where gender roles where much stricter. she was the one that beat up a group of bullies, because she thought it was unfair how they treated others. played football with the boys, even though boys didnt want to kick balls with girls. but she just didn’t take ‘no’ for an answer. to show them, she just got better than most of them.
even though ske knew there is a difference between boys and girls, she never mentioned it. IMO this, combined with her being an absolute badass, takes all the wind out of these petty arguments. “i cant hit a girl”, “you better don’t, last time she beat you up”. or “i don’t want to play with a girl”, “understandable! she is simply better than you” etc.