-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Make private functions private #1537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We've had this discusion before and I don't think we'd be willing to take this approach given the original reasons as well as the fact that it's not really backwards compatible anymore. |
Ah, should have checked the Codeplex site too for this. I do see the issues but not really the backward compatibility issue. Since private methods should never be called outside the class only code that would break is code that should break. |
Unfortunately, "should never" is not the same as "has never" - users may have previously used privates to emulate other levels of privacy like C++'s |
In addition to the issues in the linked thread, note that the |
Fair enough |
Currently private functions are put on the prototype of a function so they are not really private. I suggest adding them as normal functions in the scope of the class so that they are in fact only accessible to the class.
Example
would create
The text was updated successfully, but these errors were encountered: