2 ms·
C# has (a subset of) SQL null semantics because of LINQ. That's the answer to his specific question. Null values propagating through expressions SQL style is a
by barrkel 9y ago
C# has (a subset of) SQL null semantics because of LINQ. That's the answer to his specific question.
Null values propagating through expressions SQL style is an approach to handling unknown values. Whether it's desirable is somewhat besides the point; databases have null values, and LINQ enables capturing expression trees that get converted into SQL, so keeping similar semantics makes a kind of logical sense.
Nulls are undesirable in a language until you want to initialise large structures in a simple language with a simple compiler. Staying away from the temptation then takes ingenuity and discipline.
- bobbyi_settv 9y agoWas the behavior of null with integers really changed when LINQ was added? What would his examples have done in C# 1.0?