irllabs / ml-lib

A machine learning library for Max and Pure Data
Other
274 stars 40 forks source link

remove some asserts #172

Closed i-n-g-o closed 3 years ago

jamiebullock commented 3 years ago

Hi @i-n-g-o ... thanks for the PRs!

Can I ask what is the motivation for removing these assertions...?

i-n-g-o commented 3 years ago

Hi.

It is a while back that i removed those... maybe i did not get the reason for the asserts to be there back then.

At that moment i faced a crash in a project i needed to solve, now i just realize: the external was probably not built with NDEBUG - no such define in the Makefile.

Also now i am not sure, why execution should stop under these conditions - but maybe it's handy when debugging.

jamiebullock commented 3 years ago

OK thanks. I’m closing this one as I think the asserts are useful as they make the assumptions of the code explicit. If the NDEBUG preprocessor flag is used they will compiled to noops, and where needed a failsafe has been added e.g. assert(false); return -1;