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

We're all consenting adults. Python gets by just fine on this principle.


The argument from the Java camp is that if you always use the getters and setters, you leave the access and modification open to extension, say, by adding a callback listener for changes to a variable.

I then just say, change it when you need it, and use that fancy "find usages" thing most IDEs and vim have.


Precisely. The real reason Python gets this right is that it the properties feature lets you write `obj.foo` but still call a `getFoo` method behind the scenes.


C++Builder and Delphi offer this too, with the '__property' declarator.


As someone who writes C++ regularly, I would love to see something like __property introduced in C++15.




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

Search: