Open Bjartensen opened 5 months ago
I have a (bad) habit of making every function bool and instead of returning variables I use non-const references.
bool
I like it because if most of my functions are bool I can at all steps say
if (!some_func(&a,&b...)) return false;
to exit nicely out of functions.
It looks nice but I fear it's bad practice. If I want to keep the checking functionality I should perhaps switch to try/catch.
try
catch
Some of my bool functions are vacuous as well -- always returning true at the moment.
I have a (bad) habit of making every function
bool
and instead of returning variables I use non-const references.I like it because if most of my functions are
bool
I can at all steps sayto exit nicely out of functions.
It looks nice but I fear it's bad practice. If I want to keep the checking functionality I should perhaps switch to
try
/catch
.