☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 1 year agoDebugginglemmy.mlimagemessage-square22linkfedilinkarrow-up1116arrow-down16
arrow-up1110arrow-down1imageDebugginglemmy.ml☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 1 year agomessage-square22linkfedilink
minus-squareTheDoctor [they/them]@hexbear.netlinkfedilinkEnglisharrow-up10·edit-22 months agodeleted by creator
minus-square☆ Yσɠƚԋσʂ ☆@lemmy.mlOPlinkfedilinkarrow-up7·1 year agoI find setters/getters are generally an antipattern because they obfuscate behavior. When you access a field you know what it looks like, but if you pass it through some implicit transformation in a getter then you have to know what that was.
minus-squareTheDoctor [they/them]@hexbear.netlinkfedilinkEnglisharrow-up5·edit-22 months agodeleted by creator
minus-square☆ Yσɠƚԋσʂ ☆@lemmy.mlOPlinkfedilinkarrow-up6·1 year agolol yeah that sounds like a nightmare
minus-squarejollyrogue@lemmy.mllinkfedilinkarrow-up4·1 year agoAren’t setters and getters discouraged in Python? I remember reading something like, “This isn’t C++ , and Python doesn’t have private vars. Just set the var directly.”
minus-squareTheDoctor [they/them]@hexbear.netlinkfedilinkEnglisharrow-up2·edit-22 months agodeleted by creator
deleted by creator
I find setters/getters are generally an antipattern because they obfuscate behavior. When you access a field you know what it looks like, but if you pass it through some implicit transformation in a getter then you have to know what that was.
deleted by creator
lol yeah that sounds like a nightmare
Aren’t setters and getters discouraged in Python?
I remember reading something like, “This isn’t C++ , and Python doesn’t have private vars. Just set the var directly.”
deleted by creator