Timeline for Ruby FizzBuzz using the ternary operator two times
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 21 at 23:17 | comment | added | radarbob |
This example shows that if s without nested branching can increase clarity even compared to ternary statements. Further, the Ruby-esque "trailing IF" not only complements clarity but emphasizes the result-value over the condition that emits that value. One could say it coveys a precedence or preference of returnable values. Again it is about what you want to communicate and emphasize about the code.
|
|
Sep 18, 2023 at 9:31 | comment | added | Toby Speight |
The observation here seems to be "Don't use ternary conditional", but it's not clear why you say that. And I don't get the bit about nested if , since the code under review has no if s at all.
|
|
Sep 17, 2023 at 22:29 | history | edited | steenslag | CC BY-SA 4.0 |
deleted 3 characters in body
|
Sep 17, 2023 at 21:23 | history | answered | steenslag | CC BY-SA 4.0 |