Moin Dumu,
already admitted that Grace was earlier but ...
EAFP is a very common coding style in Python, such that it became part of their glossary.
Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many try and except statements. The technique contrasts with the LBYL style common to many other languages such as C.
IMHO they rely on it much more than Perl hackers do. I'm often surprised how often try/catch constructs are used there to handle fuzzy situations.
"Stolen" because we don't catch any exceptions in my suggestion.
|