May-06-2021, 05:13 PM
(This post was last modified: May-06-2021, 05:13 PM by Gribouillis.)
samtal Wrote:In good programming, eception handling must not be used as a logic programming item. The best practice is to avoid any exception handling while writing the code, and add it only after the code has been completed and tested. It is intended for the unknown or system errors, not for bugs correction or logic decissions.I don't know from which programming bible this comes from but I don't agree with this, especially in Python. Applying such rules leads to a super defensive programming, the opposite of the Python philosophy. It may apply in strongly typed languages perhaps. There are many creative ways to use exceptions.
In addition, the exception handling, if active while programming and testing, will hide other importand error messages.
For almost 30 years, there have been thousands of programming gurus online. Don't believe all that they say.