DEV Community

Discussion on: How I improved my code by returning early, returning often!

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

I know that pattern as guard clauses, if it's specifically used to rule out error cases at the beginning of the function.

Assertion is another word for it, but that can mean different things to different people.

The name Bouncer Pattern is new to me, but it is a good metaphor to describe what happens (It prevents unwanted input from "getting inside" the main program logic).