Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I feel that when I programmed in C++ before I went to Java, it was much more common to include more logic in your setters than just assigning the argument to the field. This is now almost twenty years ago, I was less experienced and the team I was on where I was writing C++ was small and inexperienced too, so maybe that's a misconception. But certainly, in Java the additional logic in setters is frowned upon; but so are public fields. So, it's really a cultural thing in that community. Thank goodness for records :)


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

Search: