Easier Ask for Forgiveness than Permission

July 25, 2014 by Xavier Ordoquy

EAFP - Easier Ask for Forgiveness than Permission - is a coding style where you perform an action and gracefully handle the error cases through exceptions. It contrasts with the LBYL - Look Before You Leap where you make sure all conditions are met before you perform an action.

Although it sounds like a pure coding style issue I ran into a couple of cases where it made a huge difference.

read more

1