3 ms·
Go doesn't have if-expressions, which makes propagating errors even more painful.
by codr7 5y ago
Go doesn't have if-expressions, which makes propagating errors even more painful.
- ggm 5y agoHow does this differ semantically from the C ternary operator? Not syntactically, in its outcome and expression of a testable boolean clause, and a left or right side choice which is the assignment value?
- codr7 5y agoNot much. But syntax matters; a ternary expression tells me at a glance that there's no funny stuff going on, it's just making a choice between two expressions. In Go I have to scan every single branch when reading to make sure.