>Event driven programming
>>59167242
>Brainless sheep frogposters
No, you're right, let's keep everything in a single thread and freeze up while waiting for input.
Or better yet, check for input 100000 times per second and keep waking the CPU for no good reason.
>>59167317
frogposter > autism poster
>>59167329
fuck off to ur js ,shithead
>>59167338
those aren't mutually exclusive terms, anon
>>59167338
frogposter == autism poster
Don't kid yourself OP, your denial tells all.
>>59167372
>>59167382
i have a gf and all
>>59167329
/thread
>>59167409
So you need a woman to validate your life? That's really fucking sad actually.
>>59167467
>>59167329
are you guys fucking stupid?
in an event based programming you wait for the event to fire
>>59167532
How do you know when events fire?
You have to check for them, dumbass.
>>59167549
actually OP is right , they are bad
http://cgi.di.uoa.gr/~mema/courses/mde518/papers/vonbehren.pdf
All "event-driven" programming does is defer event polling from the programmer to a framework that may or may not do it efficiently.
It's like manual memory allocation vs garbage collection.
>>59167549
hardware interrupts
>>59167621
>implying that manual memory allocations isn't bad
>>59167369await a()
await b()
await c()
await d()
await e()
const resultsFromF = await f()
console.log(resultsFromF)
>>59167681
Wouldn't that mean that a b c d & e can all run concurrently, when that is isn't true?
>>59167382
did you just use the fucking comparrison operator
>>59167625
And what does the interruption do ? Set a variable that the main program checks every so often ?
How does that solve anything ?
>>59167750
Yeah, do you have a problem with that, sperglord?
>>59167715
No, the await keyword is used to
wait for an asynchronous event to finish without blocking the event loop.
It is built on-top of es2015 Promises.
>>59167809
>>>
t.autism pajeet monkey
>>59167828
I don't get it.
>>59167839
Please explain how that makes sense. It doesn't.
>>59167861
is "which is finishing first"
>>59167771
Pretty sure it tells the OS to call callbacks.
It's better if the kernel does the polling than when the user software does it, because the kernel still can switch off unused ressources, unlike a polling software which drains your laptops batteries.
>>59167861
It blocks the calling thread to wait for an asynchronous function to finish so that every asynchronous function gets executed in order. Much easier and clearer to implement in comparison to promises and callbacks in my opinion. Javascript needed this for a long time.
>>59168010
Thanks, I get it now.
>>59167242
it's better thanobjectGeneratorGeneratorHandleCreator()
>>59167549
>You have to check for them, dumbass.
No, you don't have to check for them. The framework checks for them. And the framework is smart enough not to use polling loops or blocking I/O.
who here /event-drivenObjective-orientedFunctionalImperativeProgramming/
>Event driven programming
Is awesome.
>>59168353
How do you check for events without spawning threads for polling loops with mutexes for blocking I/O?