3 ms·
I totally get where you coming from, and even in non GC'd languages such as C++ lifetimes are extended (or not...) when you break down expression. However, I a
by seppel 7y ago
I totally get where you coming from, and even in non GC'd languages such as C++ lifetimes are extended (or not...) when you break down expression.
However, I also strongly perfer to give these subexpressions names. That tremendously helps when debugging, logging, or just discussing the code with colleagues. In fact, these subexpressions do exist and they are a certain unit to reason about, especially when the program is not doing what it should. In these cases (and not only these) you really want to give them a canonical name and not only "line 42".
Maybe there should be a syntactical equivalent for named subexpressions.
- steveklabnik 7y agoI do too, which is why I preferred prefix await.