merely-useful / py-rse

Research Software Engineering with Python course material
http://third-bit.com/py-rse/
Other
247 stars 64 forks source link

Add content on when to (and when not to) use asserts? #625

Open DamienIrving opened 3 years ago

DamienIrving commented 3 years ago

I did a Data Carpentry workshop earlier in the year and some of the very knowledgeable instructors at the workshop suggested reconsidering the use of asserts in the defensive programming lesson I delivered (see https://github.com/carpentries-lab/python-aos-lesson/issues/36 for details).

If we ever write an update of this book, I wonder if we need to add some words/advice about when and when not to use asserts. Perhaps a condensed version of the following two posts (which were mentioned in the issue I linked to above)? https://dev.to/yloganathan/do-not-abuse-the-assert-1cfm https://archive.is/5GfiG