Jon Skeet said:
Sort of. I can't think of a more elegant solution though. Admittedly
it's slightly worrying that different languages have different
operator behaviour - equality of nullable types in VB is different to
that in C#, for example.
This is a bigger issue than many think, and not just on nullable types. When
you bounce from language to language, you often find that the different way
features are handled causes you to get into situations where you end up
answering a question incorrectly for one answer that would be correct in
another.
I spend so little time in VB any more, but there are occasions where someone
has me examine some VB code and I have to.
What I'd like to see is non-nullable reference types. That could be
useful in a number of ways - although given the large body of code
already out there, it's probably too late.
I am not sure it would do much for me, but perhaps I will get more time to
ponder it later. I have, however, set up reference types that had default
values, so perhaps that would be an reason for a non-nullable reference
types.
NOTE: I am not fond of hard coded initialization of values, but it was a
better option than the client had done intially, which was chain behavior to
a constructor.
So long as you'll do me the favour in return
(I worry sometimes that people don't want to correct MVPs. Everyone is
highly fallible, IME.)
When I look back a year ago at some code, I think "man I sucked then". The
truth is, I will probably say the same in another six months to a year. And,
this is a good thing, as it means I am growing. The day I look at old code
and say "man, that is the best I have ever done" is the day I should go out
to pasture.
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box!
|
*************************************************