-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Make the statement less definitive #1190
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
Conversation
Hmm, I worry that this change doesn't actually help anyone and simply increases the complexity of the sentence. This warning is really only for people who don't understand context in JavaScript and those people lack the background information to answer the questions this qualifier raises:
Our target audience can't answer these questions for themselves and we're not interested in answering them in the docs, so it ends up just being a distraction from the central point: that they shouldn't use arrow functions in these cases, because properties on Does that make sense? |
While I understand the point of not fixing something not broken, the technical knowledge of the tip is IMO, strictly saying, incorrect. Let's review what we have here:
We're definitively saying How about tweaking the expression a bit to maintain both the correctness and simplicity? Something like:
Thoughts? |
I agree that your revision is more technically correct. 🙂 I just worry that it raises more questions than answers for anyone the paragraph is relevant to. I like where you're going with the compromise though! One missing detail I think is important is the note about "undefined", because the property will be undefined 99.9% of the time and I've seen students do a Google or in-page search that includes undefined when they see a So now that you have me thinking, what would you think about the following?
I think that might improve the clarity, accuracy, and searchability. |
Sounds good to me. If we could somehow eliminate one instance of "as you'd expect" it would be perfect! |
Good catch! I just updated my comment. 🙂 |
Reworded as such. I've made the errors inline, as our |
* Replace `true` with truthy (vuejs#1196) * Change "Registration" to "Global Registration" (vuejs#1192) * typos (vuejs#1191) * [Website]: Let menu to be above add (vuejs#1188) Signed-off-by: Bruno Lesieur <[email protected]> * Fix: Demystified markdown logic (vuejs#1186) * Fix: Demystified markdown logic I have changes jsfiddle link with a similar jsfiddle. The difference between two jsfiddle is in javascript code, `marked()` has a comment mentioning its source as external library. This is important because it is easy to assume that `marked()` cmes from an external library instead of Vue, especially for a beginner. * make dependencies apparent in markdown example * Correct the heading tags (vuejs#1181) correct the opening and closing `h4` tags * Make the statement less definitive (vuejs#1190) * Make the statement less definitive * Reword the tip * add SG exception where kebab-case everywhere is also acceptable for components in templates * revise single-file components, with new example sandbox * Add Additional Resources to ecosystem dropdown (vuejs#1182) * Add additional resources to dropdown * reorganize ecosystem dropdown, adding Tooling * Move roadmap to News section of ecosystem dropdown * Update "Core Plugins" to "Core Libraries" * rename SG complex expressions rule to simple * rename SG complex computed expressions rule to simple * address SG question about coupled component names, fixes vuejs#1195 * fix SG typos, fixes vuejs#1194 * make it more obvious in SG that details can be expanded, fixes vuejs#1170 * Update custom-directive.md (vuejs#1198) I suggest add this params demo because i can not understand when i saw this part,i think other people will have the same confusion * clarified titles of SG priority D rules * Re-translate the arrow function tip
The current statement reads:
which is true in most, but not all, of the cases. If the parent context by any chance has
a
ormyMethod
,this.a
andthis.myMethod
won't be undefined: https://jsfiddle.net/phanan/Lwh1sye2/1/This PR aims to make the statement less definitive.