I know all the FW code is written in this style but it is always interesting to me, 1 - why don't just say if ( isSyringePumpPreLoaded() ) the function is a boolean why compare to TRUE to get a bo...
I know all the FW code is written in this style but it is always interesting to me,
1 - why don't just say
if ( isSyringePumpPreLoaded() )
the function is a boolean why compare to TRUE to get a bool expression?
if it was returning an int it made sense to have something like this:
if ( isSyringePumpPreLoaded() != 0 )
Which is still unnecessary in some cases.
2 - even if we want to use TRUE, why to put it at the beginning of the expression and don't put it at the end, like
if ( isSyringePumpPreLoaded() == TRUE )
So the first thing developer sees would be the important part which is the function not always a TRUE or FALSE.