Post #2948956
2026-05-20 19:39 UTC
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"`
Replies (1)
-
@dbx12@programming.dev 2026-05-20 19:43
The last thing, that would be a "request changes" for me.