top | item 45392671

(no title)

ii41 | 5 months ago

About the `if else` producing a value matter. Well, if you look at things that way, C can be said to be syntactic sugar of assembly, as for every C program you can write equivalent assembly. `if else` producing value is very useful because it allows you to write if else wherever a value is expected. You can call methods on an `if else` or pass one as an argument of function. When such an expression is sufficiently complex your equivalent code using non-value-producing `if else` would be a lot more verbose and unreadable.

discuss

order

No comments yet.