2 ms·
I think this is a bit like the dynamic vs static typing discussion that's currently raging in another topic[1]. Being explicitly marked makes it self-documenti
by magicalhippo 5y ago
I think this is a bit like the dynamic vs static typing discussion that's currently raging in another topic[1].
Being explicitly marked makes it self-documenting. It allows someone to see just the definition to know that it is async.
This is especially useful in conjunction with interfaces (or pure virtual base classes).
In addition there's function pointers to consider.
[1]: https://news.ycombinator.com/item?id=28907154 https://news.ycombinator.com/item?id=28907154
- XorNot 5y agoIsn't this what a type system will tell me though? If I call a function and get back a promise of a value, then I know I need to do more work to get the value.