I’ve picked up some code from a colleague, and in one of his methods he has a boolean parameter: ByVal showProactiveChases As Boolean?. I had to look up the ? operator yesterday to see that it denotes a Nullable type. My question is, if I change it to: ByVal showProactiveChases As Nullable(Of Boolean), does the meaning remain the same? I think provided it doesn’t change the meaning the second way is much more readable.
I’ve picked up some code from a colleague, and in one of his methods
Share
Yes, the meaning is exactly the same.
Boolean?andNullable(Of Boolean)will be compiled to exactly the same IL.(I personally find the first version more readable, but it’s all down to personal taste.)