Dangerous Bool

October 20th, 2005 | Tags:

In the bug list of a simulation I work on at my day job is a change request to get rid of danger: “Replace Dangerous_Bool with a safer alternative”

Some time ago, to make on aspect of a program I was working on faster, I enabled an input option that would tell the program to use cached data. This sped the program up greatly, but could also have gerat consequences, because there was no way to check if the cached data was still valid: it was just being used blindly.

So instead of making the enabling flag a boolean, it was made a dangerous bool. To enable a standard boolean, you can set the value to true, but to enable a dangerous_bool you have to set the value to true_and_I_have_read_the_manual. It probably is a good time to start looking for safer alternatives.

No comments yet.
You must be logged in to post a comment.