Boolean checking in the ‘if’ condition

I would suggest that you do:

if (status) {
    //positive work
} else {
    // negative work
}

The == tests, while obviously redundant, also run the risk of a single = typo which would result in an assignment.

Leave a Comment