DEV Community

Discussion on: Unhealthy Code: Null Checks Everywhere!

Collapse
 
jamesmh profile image
James Hickey

One of the benefits of this pattern is that you typically would avoid the need for a hasBoss method (unless there's an exceptional case where you would need that check). Otherwise, using null objects should remove the need to do that.

I would agree that an array of bosses would work well, if the scenario warrants it.

Thanks! Great feedback.