tddbin / katas

Service providing katas that can be loaded into tddbin.com, most used by
https://jskatas.org
MIT License
130 stars 59 forks source link

Rest in destructuring #14

Open ehpc opened 9 years ago

ehpc commented 9 years ago

Hi! You've grouped destructuring kata into rest parameter syntax. But I think it's not correct, because in case of destructuring you are not using rest syntax, you are using spread operator instead. It just happens that spread can behave similarly to the rest syntax. In specs it is called SpreadElement http://www.ecma-international.org/ecma-262/6.0/#sec-array-initializer. And Mozilla thinks the same https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator.

wolframkriesing commented 9 years ago

do you mean this one here? https://github.com/tddbin/katas/blob/master/katas/es6/language/rest/with-destructuring.js

ehpc commented 9 years ago

Yep

wolframkriesing commented 9 years ago

you are absolutely right, thanks for bringing those things up. I think about how to not break things and will try to employ it, ideas/PRs welcome.

ehpc commented 9 years ago

What exactly are you afraid to break?

wolframkriesing commented 9 years ago

all the links on http://es6katas.org/ depend on it, esp this one (which might also be used in tweets or other places, at least I did) will change http://tddbin.com/#?kata=es6/language/destructuring/rename and having this in place might also make changes in the future safer, legacy decision :)

ehpc commented 9 years ago

If you are running Apache, you can use something like mod_rewrite with .htaccess to redirect users to a new url without deleting the old one.

wolframkriesing commented 9 years ago

yep, if I did :) but it's currently all just a static page on github :) but i can start changing the description, thats a start

ehpc commented 9 years ago

Well I don't think github has something like rewrite, so the only solution that comes to mind is moving your site to a separate hosting provider :) Or maybe just setting up a hosting as a proxy redirecting links to github as necessary.

wolframkriesing commented 9 years ago

how do you like it now? https://github.com/tddbin/katas/blob/master/katas/es6/language/destructuring/rename.js

ehpc commented 9 years ago

It's better, but still a little confusing. I would say something like "assign object property values to new variables while destructuring" sounds more to the point. And "use a colon after the property name, like so propertyName: newName".

wolframkriesing commented 9 years ago

thanks!

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

kriesing@uxebu.com, 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 Tue, Jul 28, 2015 at 12:57 PM, Eugene Maslovich <notifications@github.com

wrote:

It's better, but still a little confusing. I would say something like "assign object property values to new variables while destructuring" sounds more to the point. And "use a colon after the property name, like so propertyName: newName".

— Reply to this email directly or view it on GitHub https://github.com/tddbin/katas/issues/14#issuecomment-125556537.