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.
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.
Very much this. If you have more than one ternary operation in a statement, you need to not use any.
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.
Yeah sometimes a deep dive into the language will clear up most problems you have as a Jr.
Hell yeah! I'm with you, nothing like a set of ternary operators when you're iterating through an bunch of variables. They also make intutive sense to me, even more so than IF/ELSE even - I see the symbols and I think
"this thing happened, yea ? ok, do this : no - ok, do this"
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.