Re:How do we read code?
by Dylan16807 on Wednesday December 19, 2012 @02:05AM
(#4941519)
Assuming I know the ternary operator, I find the first version superior. Why? It only says "value = " once. I know immediately what the action of the code is when I start reading. Starting with an if makes me worry that the two code paths diverge, and also makes it take analysis to realize that 'value' is definitely assigned.
[ Parent
| on HN ]
There are no comments on this comment yet.