Do you think if statement as expression would be nice to have in D?

Guillaume Piolat first.last at gmail.com
Sat Jun 4 11:41:13 UTC 2022


On Friday, 3 June 2022 at 18:33:57 UTC, Jack wrote:
> do you think would be nice that in D as well? I find it can 
> increase code reability...

No.

The feature comes from Ocaml, where match, if, and any statements 
are expressions.
Even there, it doesn't make things especially readable.
It's more about an ideology that all statements must be 
expressions.
Something that readable languages, like Python, Java, COBOL, 
BASIC... did not retain.


More information about the Digitalmars-d mailing list