DEV Community

Discussion on: What’s an unpopular software opinion you have?

Collapse
 
bertilmuth profile image
Bertil Muth

Kudos to the ternary operator! I greatly appreciate your compactness from time to time! And don’t let those bullies tell you you’re hard to read. You are fine just the way you are. W?t:f.

Collapse
 
frothandjava profile image
Scot McSweeney-Roberts

The main argument against it seems to be "junior devs won't understand it". I think the answer to that is that they should learn the language.

Collapse
 
ronjdaugherty34 profile image
Ronald Daugherty • Edited

Yeah sometimes a deep dive into the language will clear up most problems you have as a Jr.

Collapse
 
turnerj profile image
James Turner • Edited

Key phrase: time-to-time

Don't mind ternary operators for simple cases but once someone starts putting multiple function calls in each part of the operator, it makes it difficult to debug.

Collapse
 
astarael2 profile image
Simon Mills

Very much this. If you have more than one ternary operation in a statement, you need to not use any.

Collapse
 
ben profile image
Ben Halpern

lol