• 1 Post
  • 1.64K Comments
Joined 3 years ago
cake
Cake day: July 6th, 2023

help-circle


















  • One of my coworkers is fond of using ternary expressions instead of “if” blocks. Even ones without an “else”. So I see things like:

    condition ? someVar = "blah" : null;

    or

    condition ? doSomething() : null

    Which should both just use “if” statements. Or my favorite:

    condition ? someVar = "foo" : someVar = "bar"

    which should really be

    someVar = condition ? "foo" : "bar"