3 ms·
I once worked for a place that explicitly told me not to do this. They also told me to test booleans with if( booleanVariable == true ) ... This was also t
by logfromblammo 7y ago
I once worked for a place that explicitly told me not to do this. They also told me to test booleans with
if( booleanVariable == true ) ...
This was also the place that ordered me not to use LINQ statements because, and I quote, "you need to write code that someone fresh out of high school could understand". I don't work there any more.
- lnanek2 7y agoWe actually have to write boolean checks like that in Kotlin nowadays in modern Android development. If your variable type is Boolean? instead of Boolean, it is needed to both check if it is non-null and true.
- logfromblammo 7y agoI was also not allowed to use the C# ?? null-coalesce operator. So something like if( nullableBooleanVariable ?? false ) was also forbidden.