5 ms·
I found the first solution easier to understand, but I have this infuriating (even to myself) obsession with ternary operators that could introducing some bias.
by blippitybleep 3y ago
I found the first solution easier to understand, but I have this infuriating (even to myself) obsession with ternary operators that could introducing some bias.
- jay_kyburz 3y agoI like them when the actually fit one one line. If I have to scroll horizontally I will roll my eyes. And I really hate nested ternaries. One of my pet hates is when the c# style is for opening braces on a new line, making if/then/else statements much longer than they need to be, so people try to cram as much into a single ternary as possible.
- blippitybleep 3y agoyeah, they need to be tidy. You can shoot an unsuspecting programmer through the soul with some evil ternary abuse.
- pwdisswordfishc 3y agoMy biggest beef with the former solution is that resultsEntries is unnecessarily stored in a variable, and between its declaration and use there is an interspersed declaration of a general utility function. I might have inlined that one as well. This is what harms readability the most. Code should be arranged general-to-specific, and this example violates that. Although given that there are only two properties to process, the gopher-style assignment code preferred by the author would suffice anyway.