coatless-textbooks / c4ds

Computing for Data Science is a work in progress tutorial book being made for STATS 290 at Stanford University
https://c4ds.thecoatlessprofessor.com/
0 stars 1 forks source link

Mention stopifnot() and general assertion strategies? #17

Open eddelbuettel opened 3 weeks ago

eddelbuettel commented 3 weeks ago

Nice debugging chapter. Relying a stopifnot("error message here" = condition_to_meet(), "another error" = another_condition()) is a good pattern worth mentioning.

coatless commented 3 weeks ago

Thanks! I'm planning to have "Error Debugging" separate from "Error Design and Handling". So, I'll make sure stopifnot() is covered in that section. 👍

eddelbuettel commented 3 weeks ago

If we're picky we could say it's neither but belongs in a section such as this. Anyway, I trust you'll get it covered.