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
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.
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.
The text was updated successfully, but these errors were encountered:
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.
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
andhidden
.In another issue, @allenwb wrote:
I would challenge that the way they differ is so important that it requires different keywords. "importance" is very relative to context.
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.
The text was updated successfully, but these errors were encountered: