You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't see how. When used with intention, the public property is part of the class' contract. That link only shows a "high-performance" way to bypass said contract. I put high-performance in quotes because accessing a public property is still faster. :)
I have come across the rule in the past that "ALL THE THINGS MUST BE PROTECTED". And I usually fall into the camp that says that any rule that includes the words "all of the time", "always", "never", etc, is going to be wrong at some point. I agree in general that things should be protected, with getter/setter methods, and I have done it that way through the vast majority of the framework. When things are public, they typically needed to be that way for a reason.
A user on the IRC channel (crazywane) seems to think that public properties are a problem?
https://gist.github.com/Golpha/c64bc7a67db1ed9463f7fec13e1e6f4c
The text was updated successfully, but these errors were encountered: