Re:Show HN: A pure C89 implementation of Go channels, with b...
by kevindamm on Thursday December 14, 2023 @03:15AM
(#38639021)
In that case you can have the result of a function call be assigned to the const, and the function be the if/else for the value. With a well-named function it can even be more readable than the ternary.
[ Parent
| on HN ]
Re:Show HN: A pure C89 implementation of Go channels, with b...
by IlliOnato on Thursday December 14, 2023 @08:15AM
(#38640978)
Having to create a function where a simple expression would suffice is "typing in mittens" programming...
Re:Show HN: A pure C89 implementation of Go channels, with b...
by kevindamm on Thursday December 14, 2023 @09:28AM
(#38641677)
Fair enough.. I actually use ternary sometimes, especially in brief return statements, and especially when both results are simple values. I only really avoid it when the result expressions are multiline. I just felt like pointing out the obvious when I saw GP's comment.