Sebastian Witowski 8/19/2020

Ask for Forgiveness or Look Before You Leap?

Read Original

This article discusses two fundamental programming paradigms: 'Look Before You Leap' (LBYL), which involves preemptive checks before actions, and 'Easier to Ask for Forgiveness than Permission' (EAFP), which relies on exception handling. It uses Python examples, like reading a file, to illustrate the trade-offs in code simplicity, error coverage, and potential performance implications between the two approaches.

Ask for Forgiveness or Look Before You Leap?

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week