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

No documentation on asterisks #81

Closed
taoeffect opened this issue Jan 23, 2014 · 18 comments · Fixed by #154
Closed

No documentation on asterisks #81

taoeffect opened this issue Jan 23, 2014 · 18 comments · Fixed by #154
Labels

Comments

@taoeffect
Copy link

There needs to be documentation on asterisks, in one of the first paragraphs of the main Readme.

It is not at all clear to anyone new to generators in javascript what they are for, or that they are associated in any way with something called "generators", whether they represent new syntax or not, etc.

The status quo results in unnecessary wasted time for many people.

Here's some documentation about the topic, but even after reading it, I'm still unclear as to whether these symbols are necessary or not.

@tj
Copy link
Owner

tj commented Jan 23, 2014

will do, but yup they're necessary

@jonathanong
Copy link
Contributor

i was working on a better readme but the draft i ended up with wasn't much of an improvement so i scraped it. can you list some specific stuff you are confused about? i know there have been a bunch of blog posts - maybe the best parts or ah-hah moments of those would help too.

@reqshark
Copy link

just make sure to talk about spacing and astrixises, that's where i personally need guidance. I also have a suspicion of generator relationship with the new domains of node API lore. if some comparison therein could be made kudos

@taoeffect
Copy link
Author

@jonathanong acknowledging them before they are used would be a good start, along with an explanation of what they mean, how they are supposed to be used, their significance and any gotchas (what versions of node support them? what OS's support them? what about browsers? what's the future? etc.)

@jonathanong
Copy link
Contributor

what spacing? and it has nothing to do with domains.

@reqshark
Copy link

well i meant the space and the astrixis

@reqshark
Copy link

domains are more like generators in general that's very different.

@jonathanong
Copy link
Contributor

are we talking about function *() {} vs. function *(){}? i'm not sure what you mean by spacing.

@reqshark
Copy link

that helps

@jonathanong
Copy link
Contributor

OH you meant in comparison to domains. i thought you implied that they were related haha

@reqshark
Copy link

they are yes wtf is domain.run() versus yield

@tj
Copy link
Owner

tj commented Jan 23, 2014

domains == huge hack to catch errors, yield == language-provided non-hack to write synchronous code and also happens to let you catch errors with try/catch

@tj
Copy link
Owner

tj commented Jan 23, 2014

other than the error aspect they're unrelated, but I would never use them

@reqshark
Copy link

thats exactly what i was asking

@jonathanong
Copy link
Contributor

honestly i don't know much about domains. they seem very confusing to me. co is closer to fibers than domains.

from what i understand about domains, they catch "uncaught exceptions" and errors emitted from event emitters versus co-generators which use traditional try/catch blocks.

one caveat though with co-generators is that event emitters without any error listeners will still throw and kill your process, which is what half the issues in koa are currently about

@tj
Copy link
Owner

tj commented Jan 23, 2014

yea domains are basically global state, errors just get tacked to the current domain within the function, massive hack

@jonathanong
Copy link
Contributor

@visionmedia perhaps we should just combine co and koa help? koajs/help#1. could make that repo a wiki where people can collaborate on docs and ask questions perhaps. maybe rename it to wiki.

everything in koajs/koa can remain dull and official.

@plievone
Copy link
Contributor

plievone commented Feb 1, 2014

are we talking about function *() {} vs. function *(){}? i'm not sure what you mean by spacing.

I guess with spacing he meant
function *() {}
function* () {}
function * () {}
function*() {}
All work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants