Question: I was wondering what was the most clean and understandable syntax for doing condition checks on nullable bools. 

Is the following good or bad coding style? Is there a way to express the condition better/more cleanly?

```
bool? nullableBool = true;
if (nullableBool ?? false) { ... }
else { ... }

```

especially the **if (nullableBool ?? false)** part. I don't like the `if (x.HasValue && x.Value)` style ...

*(not sure whether the question has been asked before ... couldn't find something similar with the search)*

Answer: 
Another way is to use [constant pattern matching](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/is#constant-pattern):

```cs
if (nullableBool is true) {}
if (nullableBool is false) {}
if (nullableBool is null) {}

```

Unlike the operator `==`, when reading the code, this will distinguish the nullable type check from ordinary "code with a smell".
If you only want to test for `true` against `null`/`false`, One I've just used and reads quite well is

```
bool? someCondition = null
if (someCondition.Equals(true))
...

```