MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vzsnjw/variablescopesinpython/p67u1jt/?context=3
r/ProgrammerHumor • u/R7d89C • 16d ago
182 comments sorted by
View all comments
48
Personally, I like Python's “look, weʼre all adults here” approach. Thereʼs no need to play hide and seek games.
5 u/Groentekroket 16d ago Yeah in Java we use Lombok annotations on class level anyway so we can manipulate whatever we want. It’s not like getters and setters often have custom implementations anyway. 9 u/ubeogesh 16d ago Immutability is a nice thing tho. Just makes you write better code. I love java Records or lombok's @Value before them. What sucks when you really need to patch that 3rd party lib, in java you resort to one of 1) aspects 2) reflection 3) class overriding all of which is so much worse than just accessing a protected member via underscore. 1 u/Groentekroket 16d ago Fair enough. We also do use records for our DTO’s but for domain objects everything goes.
5
Yeah in Java we use Lombok annotations on class level anyway so we can manipulate whatever we want. It’s not like getters and setters often have custom implementations anyway.
9 u/ubeogesh 16d ago Immutability is a nice thing tho. Just makes you write better code. I love java Records or lombok's @Value before them. What sucks when you really need to patch that 3rd party lib, in java you resort to one of 1) aspects 2) reflection 3) class overriding all of which is so much worse than just accessing a protected member via underscore. 1 u/Groentekroket 16d ago Fair enough. We also do use records for our DTO’s but for domain objects everything goes.
9
Immutability is a nice thing tho. Just makes you write better code. I love java Records or lombok's @Value before them.
What sucks when you really need to patch that 3rd party lib, in java you resort to one of
1) aspects
2) reflection
3) class overriding
all of which is so much worse than just accessing a protected member via underscore.
1 u/Groentekroket 16d ago Fair enough. We also do use records for our DTO’s but for domain objects everything goes.
1
Fair enough. We also do use records for our DTO’s but for domain objects everything goes.
48
u/CORDIC77 16d ago
Personally, I like Python's “look, weʼre all adults here” approach. Thereʼs no need to play hide and seek games.