3 ms·
I don't like the code pattern if ( false == func() ). Function func() already returns a boolean, no need to compare that to a second boolean (false or true) to
by billforsternz 4y ago
I don't like the code pattern if ( false == func() ). Function func() already returns a boolean, no need to compare that to a second boolean (false or true) to generate a third boolean.
Sorry, a little off topic I know.
- spacedcowboy 4y agoIt's there for illustration, that's all. I don't actually write code like that, but I want to make sure that you understand the condition in the code snippet.
- rocqua 4y agoIn languages without type coercion, it helps add some type checking by ensuring you return a bool rather than some value that has truthity.