DEV Community

Discussion on: Early Return Pattern

Collapse
 
i3uckwheat profile image
Briggs Elsperger

It's important to understand that removing something from code itself isn't always a good thing. However, it can be a useful tool to help clean something up when it's called for. It's another tool in the tool-belt, not an end-all.

I'd argue that ternaries, while being shorter, make it more difficult to read if-else chains in a lot of cases. However, that isn't always the case!