3 ms·
>And using public fields in a non trivial project is a sure receipt for disaster. Why, though? Surely it's the programmers' job to access what they need and le
by andrepd 10y ago
>And using public fields in a non trivial project is a sure receipt for disaster.
Why, though? Surely it's the programmers' job to access what they need and leave alone what the don't. As someone else said, Python has no concept of public/private and it works okay.
- jedmeyers 10y agoIf you make the statically typed field public you lose the ability to change the implementation without breaking the clients. (Getters/setters have the same problems, but not as pronounced). And no, you don't always have the ability to recompile everything that's using your code.
- colejohnson66 10y agoAn argument for properties are to hide the implementation details. It keeps idiots from changing variables they shouldn't (if they really want to, there's sometimes reflection), and it hides implementation detail variables from the autocomplete box.
- lmm 10y agoPython doesn't really "work okay" for ongoing projects. Framework updates become a 6-month migration job.