Skip to content
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

Rename all private properties to start with _underscore? #1104

Closed
shadowspawn opened this issue Nov 23, 2019 · 1 comment
Closed

Rename all private properties to start with _underscore? #1104

shadowspawn opened this issue Nov 23, 2019 · 1 comment

Comments

@shadowspawn
Copy link
Collaborator

shadowspawn commented Nov 23, 2019

We have some properties (including functions) on Command which are intended to be private but do not start with an underscore.

Advantages of renaming them are:

  • make it clearer that they are private
  • reduce noise in code completion suggestions in editors
  • reduce name collisions when storing option values as properties on Command

We would treat this as a breaking change and a major version bump, since some clients will be using private properties whether by accident or design.

I am interested if many readers are using or overriding private properties. I suspect some clients customise the error display via missingMandatoryOptionValue et al.


For interest, there is a proposal for true private fields in javascript:

@shadowspawn shadowspawn added the semver: major Releasing requires a major version bump, not backwards compatible label Nov 23, 2019
@shadowspawn
Copy link
Collaborator Author

I like the idea of cleaning up the autocompletion, but no one has complained. Since it would break anyone currently using a private property, not confident the cost/benefit is worthwhile for now.

@shadowspawn shadowspawn removed the semver: major Releasing requires a major version bump, not backwards compatible label Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant