-
Notifications
You must be signed in to change notification settings - Fork 2k
super
apply instead of call
#2354
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
|
you guys are quick, thank you :) |
FWIW, I really don't like the fact that |
+1 for super reference :) |
I don't really like the semantics of "naked super" as well ... it is a bit magic -- but exposing the reference is far worse, I think. Within a function |
That sounds fine to me. |
I prefer an approach like objective-C In coffeescript, |
The reason why we don't want to do that is because it violates encapsulation. While it's legit to override a method and defer to the parent's implementation for part of the behavior, it's an anti-pattern to reach behind a different method's back to call a super implementation. You should be calling ... and just to be clear, I'm not sure that we should change this at this point -- it'd be massively backwards incompatible. |
No worries, it's just a debate. not entitling to anything. And you are right about encapsulation. |
Closing as no longer relevant in CS2. |
Any syntax to get
super
to do anapply
instead of acall
with you pass in arguments?repl link
Thanks
The text was updated successfully, but these errors were encountered: