3 ms·
> It has the async/await syntax except it's extensible to any kind of coroutine semantics Interesting, I didn't know about this. > You're also not forced to us
by ironmagma 6y ago
> It has the async/await syntax except it's extensible to any kind of coroutine semantics
Interesting, I didn't know about this.
> You're also not forced to use it when it is not a good fit.
But like all language criticisms that contain this sentence, it's better when the language makes it somewhat tedious to go outside of the norm, where the norm is defined as the 99% use case. C++ is the opposite; you have to go out of your way to use the generic, safe features like smart pointers or create copy constructors.
Rust's syntax takes cues from ML which means that things like switch statements (matches), if's, and even return are also expressions, which makes it nicer to refactor and allows you more choices when structuring your code.