3 ms·
TLDR don't use a boolean, leave the field empty (NULL) and set a timestamp when should be true. To be honest a tldr isn't actually needed, the post is both ver
by ghego1 5y ago
TLDR don't use a boolean, leave the field empty (NULL) and set a timestamp when should be true.
To be honest a tldr isn't actually needed, the post is both very concise, straight to the point, and convincing.
As per the languages I use more often to query DBs (TS, JS, PHP, Python) I don't see any downside. Evaluating if a variable is empty or not, or it's type, is not "bad", compared to evaluating if a variable is true or false. Even in TypeScript in strict mode, evaluating if a variable with type number is empty or not will result in validly typed code, without any noticeable difference compared to evaluating a variable with type boolean.