Re:The Design of C++ (1994) [video]
by msorvig on Saturday September 10, 2016 @03:58AM
(#12468204)
But this is not particularly good imperative style. You want that to be line-based when expressions have side effects. ("one thing after another"):
Of course if you are calling pure functions you can use nested expressions. And then the order of evaluation does not matter.
[ Parent
| on HN ]
I believe the issue is that C++ does not track what are, and are not pure functions, so the ordering optimisation is, in general, unsafe.
> You want that to be line-based when expressions have side effects.
No, I really don't. I don't want three lines instead of one line of code. And I don't want two named variables leaking into my scope. (I could encapsulate the block with {} here, but if print returned a value that I wanted to capture, then I couldn't do that.)