Giter VIP home page Giter VIP logo

Comments (8)

wolframkriesing avatar wolframkriesing commented on June 21, 2024

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?

from katas.

JonathanPrince avatar JonathanPrince commented on June 21, 2024

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.

from katas.

tobireif avatar tobireif commented on June 21, 2024

The current version of the test case also has destructuring, right? :)
My version features shorter but slightly more complex destructuring though.

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.
(I could create a PR, where also the next test case could be shortened to

generator.next();
let {value, done} = generator;

)

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.

from katas.

wolframkriesing avatar wolframkriesing commented on June 21, 2024

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.
thanks for the input anyways, I like those discussions. Also to see and be able to articulate better what I see as important in katas.

from katas.

tobireif avatar tobireif commented on June 21, 2024

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

let thisStep = generator;
let [value, done] = [thisStep.value, thisStep.done];

to

let thisStep = generator;
let value = thisStep.value;
let done = thisStep.done;

I could create a PR.

Thanks for the katas!

from katas.

wolframkriesing avatar wolframkriesing commented on June 21, 2024

what does @jonathan think? I think this one is simple enough to understand,
the const {value, done} = generator.next() would be less
readable/accessible and add a hurdle, in the current solution, you see all
variables and their sources.
I am fine with the pure non-destructuring version or the [value, done] = [...] version

Kind regards / Saludos / Mit freundlichen Grüßen
Wolfram Kriesing, uxebu Co-Founder

[email protected], mobile: +49 174 300 4595

Learn ES6, one kata a day http://es6katas.org

uxebu GmbH
Goethestraße 28
86161 Augsburg

Amtsgericht Augsburg, Handelsregister HRB 28613
Directors: W. Kriesing, T. v. Klipstein

On Mon, Jul 20, 2015 at 3:10 PM, Tobi Reif [email protected] wrote:

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

let thisStep = generator;
let [value, done] = [thisStep.value, thisStep.done];

to

let thisStep = generator;
let value = thisStep.value;
let done = thisStep.done;

I could create a PR.

Thanks for the katas!


Reply to this email directly or view it on GitHub
#12 (comment).

from katas.

JonathanPrince avatar JonathanPrince commented on June 21, 2024

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.
As far as this case is concerned I think its ok as it is, but assigning the two variables separately would also be fine.

from katas.

tobireif avatar tobireif commented on June 21, 2024

I'd also be fine with either of the remaining two options. The decision's up to you Wolfram :)

from katas.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.