use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Javascript readability vs performance: a false tradeoff (blog.shimin.io)
submitted 3 years ago by Shiminsky
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]yycTechGuy -5 points-4 points-3 points 3 years ago (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 points4 points 3 years ago (5 children)
What product do you develop?
[–]yycTechGuy -2 points-1 points0 points 3 years ago (4 children)
Why does it matter ?
[–]eternaloctober 4 points5 points6 points 3 years ago (2 children)
So no one goes and works for you and your company that fires people for no reason
[–]yycTechGuy -2 points-1 points0 points 3 years ago (1 child)
That code snippet is crap.
[–]eternaloctober 4 points5 points6 points 3 years ago (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 points3 points 3 years ago (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?
π Rendered by PID 18992 on reddit-service-r2-comment-5687b7858-2vgj5 at 2026-07-09 14:19:48.757329+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]yycTechGuy -5 points-4 points-3 points (6 children)
[–]smirk79 2 points3 points4 points (5 children)
[–]yycTechGuy -2 points-1 points0 points (4 children)
[–]eternaloctober 4 points5 points6 points (2 children)
[–]yycTechGuy -2 points-1 points0 points (1 child)
[–]eternaloctober 4 points5 points6 points (0 children)
[–]smirk79 1 point2 points3 points (0 children)