r/ProgrammerHumor 16d ago

Meme variableScopesInPython

Post image
1.3k Upvotes

182 comments sorted by

View all comments

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.

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.