DEV Community

Discussion on: Why I'm phasing out ternary statements

Collapse
 
xanderyzwich profile image
Corey McCarty

I agree for the most part ternaries become cumbersome fast. I'd like to address the next hurdle down the path and say that if you are writing single line of statements in Java then you should use braces as it is easier to tweak later without having to add them in. Also, I've personally come across some terribly formatted code where single line if blocks were used along with inconsistent indent and it becomes a nightmare to read.