Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
To Hell with Setters and Getters (erik-engheim.medium.com)
3 points by socialdemocrat on Nov 26, 2020 | hide | past | favorite | 3 comments


This is why I like Ruby, something can look like a variable but be a setter/getter under the hood. Wish all languages had that functionality. Maybe many do that I'm not aware of, with some metaprogramming hackery.


Many recent languages have properties (https://en.wikipedia.org/wiki/Property_(programming) )


An article about why using setters and getters for member variables is frequently a bad choice.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: