I would just generally stay away from anything that wasn’t typed language. I’ve been there and don’t like it. But when I have to I have enough experience to see where the pitfalls are.
I deal with a legacy system where one of the previous programmers really liked text string booleans. My isTrue tests for true, "true", 1, "1", "yes", and "on".
View all comments
Show parent comment
25
u/JayCroghan Mar 15 '22
if (bool == 1 || bool || bool.ToString().ToLower == “true”)
Yay