When I’m using an If statement and I want to check if a boolean is false should I use the ‘Not’ keyword or just = false, like so
If (Not myboolean) then
vs
If (myboolean = False) then
Which is better practice and more readable?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Definitely, use ‘Not’. And for the alternately, use ‘If (myboolean)’ instead of ‘If (myboolean = true)’
The works best if you give the boolean a readable name: