(?)
Quotes are added by the Goodreads community and are not verified by Goodreads. (Learn more)

“In plain English, an assert statement says, “I assert that this condition holds true, and if not, there is a bug somewhere in the program.” Unlike exceptions, your code should not handle assert statements with try and except; if an assert fails, your program should crash. By failing fast like this, you shorten the time between the original cause of the bug and when you first notice the bug. This will reduce the amount of code you will have to check before finding the code that’s causing the bug. Assertions are for programmer errors, not user errors. For errors that can be recovered from (such as a file not being found or the user entering invalid data), raise an exception instead of detecting it with an assert statement.”

Albert Sweigart, Automate the Boring Stuff with Python: Practical Programming for Total Beginners
Read more quotes from Albert Sweigart


Share this quote:
Share on Twitter

Friends Who Liked This Quote

To see what your friends thought of this quote, please sign up!

0 likes
All Members Who Liked This Quote

None yet!


This Quote Is From


Browse By Tag