-
Notifications
You must be signed in to change notification settings - Fork 61
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
Shorter version of kata 51 "generator:yield" test case #2 #12
Comments
that would work, i tried it. though it adds an extra layer of complexity, which is that the user HAS TO understand destructuring (which should also be mentioned in the metadata then) ... do you think this is acceptable, when you want to learn "just" how a generator works? |
i personally think that the longer version is more helpful in the context of a learning tool, also since the following tests build on the same structure. |
The current version of the test case also has destructuring, right? :) If you require knowledge of destructuring (which is OK, if destructuring gets demonstrated in an earlier kata), you could use my shorter code if you want.
) Or if no knowledge of destructuring should be required, at all, you might want to consider getting rid of the array-based destructuring assignment as well. |
I would not assume any certain order of how the katas are done. therefore keeping the complexity simple is a plus imho. This might change over the next year, and if destructuring really has gotten stuck in all people's minds, this kata might use it more hard-core, but not yet. |
If you don't want to require any knowledge of destructuring (neither object- nor array-based desctructuring), you'd have to get rid of the current array-based destructuring assignment as well, I think. From current code
to
I could create a PR. Thanks for the katas! |
what does @jonathan think? I think this one is simple enough to understand, Kind regards / Saludos / Mit freundlichen Grüßen kriesing@uxebu.com, mobile: +49 174 300 4595 Learn ES6, one kata a day http://es6katas.org uxebu GmbH Amtsgericht Augsburg, Handelsregister HRB 28613 On Mon, Jul 20, 2015 at 3:10 PM, Tobi Reif notifications@github.com wrote:
|
it makes sense to limit the number of new language features in each kata, however using fairly basic ES6 features such as a little destructuring in more advanced katas seems reasonable. |
I'd also be fine with either of the remaining two options. The decision's up to you Wolfram :) |
Not an issue/bug, just an offer:
I could change (via PR) the initial code
from
let thisStep = generator;
let [value, done] = [thisStep.value, thisStep.done];
to shorter
let {value, done} = generator;
.
The text was updated successfully, but these errors were encountered: