One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
It still have a problem common with Promise is that you may launch your promise and forget to "await" or ".then()" it, and then you have still done your side effect but didn't wait for it. Of course you may say that it's the programmer who is stupid for doing a simple mistake, but in my opinion when thousands of programmers do the same mistake, it's the designer of the library that did one.
In Kotlin, coroutines have solved this:
suspending functions are awaiting by default, you don't need to await explicitely
Flow give you cold asynchronous streams - like in reactive sterams / RxJs / RxJava - while Promise and async/await are hot
async/await
is a big step forward for JavaScriptIt still have a problem common with Promise is that you may launch your promise and forget to "await" or ".then()" it, and then you have still done your side effect but didn't wait for it. Of course you may say that it's the programmer who is stupid for doing a simple mistake, but in my opinion when thousands of programmers do the same mistake, it's the designer of the library that did one.
In Kotlin, coroutines have solved this:
suspending functions
are awaiting by default, you don't need to await explicitelyFlow
give you cold asynchronous streams - like in reactive sterams / RxJs / RxJava - while Promise and async/await are hotKotlin / kotlinx.coroutines
Library support for Kotlin coroutines
kotlinx.coroutines
Library support for Kotlin coroutines with multiplatform support This is a companion version for Kotlin
1.3.61
release.Modules
I really love Kotlin for this.
Another easy for Kotlin is generators and yields.
Nice info! Thanks a lot π