10 ms·
What the... ? Why is that worth remembering? Just reading that code makes me feel dirty, let alone deploying it! ;-)
by SavantIdiot 5y ago
What the... ? Why is that worth remembering? Just reading that code makes me feel dirty, let alone deploying it! ;-)
- mst 5y agoSometimes the logic in at least one of the arms of the if/else is sufficiently complicated to make it worthwhile (e.g. cases where you find yourself needing a 'do' block inside a ternary). Also doing that with if/elsif/elsif/else is often far more readable than nested/chained ternaries.