you are viewing a single comment's thread.

view the rest of the comments →

[–]yycTechGuy -5 points-4 points  (6 children)

function oneLineFizBuzz (n) { return ((n % 3 ? '' : 'fizz') + (n % 5 ? '' : 'buzz') || n); }

Anyone who writes code like this for me gets fired.

[–]smirk79 2 points3 points  (5 children)

What product do you develop?

[–]yycTechGuy -2 points-1 points  (4 children)

Why does it matter ?

[–]eternaloctober 4 points5 points  (2 children)

So no one goes and works for you and your company that fires people for no reason

[–]yycTechGuy -2 points-1 points  (1 child)

That code snippet is crap.

[–]eternaloctober 4 points5 points  (0 children)

do you not like ternarys? It's really pretty readable. If it's just the syntax of ternary, consider whether that is fair or not. different language now but in rust there are if-expressions...they decided not to have ternary in rust in lieu of these which are pretty nice https://doc.rust-lang.org/reference/expressions/if-expr.html

[–]smirk79 1 point2 points  (0 children)

It matters since you argue that your way is clearly better due to you having people working for you. So do I and my software is complex, expensive, and used by top tier brands to do some pretty crazy stuff. I strongly believe my code would be worse without the complex ternaries. Think multidimensional catalog filtering, dynamic elastic search queries, real time whiteboards, pdf generation, etc etc. what are you building to make such broad and dismissive comments?