Is using nested tenary operators a good practice?

New
KpQh31

New

KpQh31
Dec 23, 2020 10 Comments

My boss loves nested tenary operators, saying it is ‘elegant’.

I don’t find it much meaningful. I find it hard to read when especially i’m reading the codebase for the first time.

I am ok with just one level, simple tenary operator. But when it becomes a two level deep, I have this impulse to refactor it in a simpler way. If I say this, my boss says “Come on! It’s not that difficult!”

What’s the best practice for this?

#engineering #software #swe #bestpractice #softwareadvice

comments

Want to comment? LOG IN or SIGN UP
TOP 10 Comments