Skip to content
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

Teach people how to work with (async) generators #74

Open
lukejagodzinski opened this issue Apr 28, 2020 · 4 comments
Open

Teach people how to work with (async) generators #74

lukejagodzinski opened this issue Apr 28, 2020 · 4 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@lukejagodzinski
Copy link

I really like the idea behind this framework. It's great that it just uses language built in concepts instead of reinventing things like React does with Suspense. When I first heard about Suspense, I was actually a big fan of it but after reading about Crank, I've changed my mind :D.

However, getting back to the topic :). When using Crank, you will have to use generators and async generators. There is no way around it and it's actually a good thing :). But for many people it will be a barrier to switch from React, where use of generators is limited. I've read about generators and async generators a few years ago but to be honest I've never had a need to use them until now :). And believe me, it's hard to get used to new "syntax" after so many years of using React and just to reason in those async concepts. Especially when you start seeing async generators and loops.

So my point is that early in the docs there should be some links to good resources about generators and async generators, tutorials, video tutorials etc. I think people are quite familiar with async/await already but generators/async generators is something that most people don't use and don't understand. Actually, I plan to refresh my knowledge about that beside having more than 10 years of work experience in JS. I just didn't have to use (async) generators so far :)

@ryhinchey
Copy link
Contributor

I think most developers don't use or think about generators and iterables/iterators in general. Like you mention, the fact that you need to know these concepts to effectively use Crank may be a barrier for some people. We'll want to have resources for sure.

The massive benefit with Crank is that you're not learning a framework's special api, you're learning JS concepts!

I find Axel Rauschmayer's content to be top notch on pretty much every JS topic he writes about. Here are some articles relevant to Crank that we could potentially add as resources:

https://2ality.com/2015/02/es6-iteration.html
https://2ality.com/2015/03/es6-generators.html
https://2ality.com/2016/10/asynchronous-iteration.html

@lukejagodzinski
Copy link
Author

The massive benefit with Crank is that you're not learning a framework's special api, you're learning JS concepts!

Yes, that's definitely a massive benefit! There are still some things that are library specific like JSX and few other things that need to be learned and understood. But at least for people coming from React it shouldn't be tough switch.

It's good that you plan to add some resources to docs. And thank you for the links, I will definitely check it out.

@brainkim brainkim added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Apr 28, 2020
@BrandonNoad
Copy link

You Don't Know JS has a good chapter on generators: https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/async%20%26%20performance/ch4.md

@brainkim
Copy link
Member

Yes the You Don’t JS is a really good resource! I’ve also recommended https://davidwalsh.name/es6-generators which is also by Getify, but perhaps slightly more beginner friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants