merely-useful / py-rse

Research Software Engineering with Python course material

Home Page:http://third-bit.com/py-rse/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

DamienIrving opened this issue · comments

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 carpentries-lab/python-aos-lesson#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