Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


I 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.


yeah, they need to be tidy. You can shoot an unsuspecting programmer through the soul with some evil ternary abuse.


My 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: