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

Two keywords to mean essentially the same thing #41

Open
DavidBruant opened this issue Mar 20, 2018 · 1 comment
Open

Two keywords to mean essentially the same thing #41

DavidBruant opened this issue Mar 20, 2018 · 1 comment

Comments

@DavidBruant
Copy link

If i understand correctly, hidden methods and instance variables are essentially the same thing, that is the moral equivalent of private properties/methods of other class-based languages (available to the instance, but not directly available to anyone holding a reference to the instance).

But I'm surprised by the choice of two different keywords var and hidden.

In another issue, @allenwb wrote:

An important part of this design is emphasizing that "instance variables" are not properties. They differ from properties in many important ways

I would challenge that the way they differ is so important that it requires different keywords. "importance" is very relative to context.

and we believe that it is bad to lead JS programmers down a path where they don't fully understand all of those differences.

Having taught JS to over 100 people by now, I believe JS is hard enough as it is for beginners (whether they're new to programming at all or come from a different language).

I don't really care about the keyword itself, but i believe having the same keyword for both cases would make the language less harder (!) to learn for beginners.

@zenparsing
Copy link
Owner

Thanks for the feedback @DavidBruant!

I don't really care about the keyword itself, but i believe having the same keyword for both cases would make the language less harder (!) to learn for beginners.

That's definitely a goal I think we all share, and this particular suggestion has been mentioned a few times now.

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

2 participants