Kathiresan Moorthy
New member
- Joined
- Mar 8, 2019
- Messages
- 1
- Programming Experience
- 10+
Till C# 7, string can accept null values, why the concept of non-nullable is introduced in C# 8. This sounds weird. It doesn't makes sense to use "string?". Some one please clarify.
If the idea is to avoid just null references. As a C# developer, I've noticed most of the C# developers handle string checking for null always. So this feature doesn't seem to be really helpful, rather introduced a confusion. I've seen Null reference exceptions mostly when objects are referred without checking if it's null.
IMO, I may be missing the greatness of this new feature, but this really introduce complexity in understanding what string type is. string basically should accept a "null". Non-nullable string doesn't makes sense.
If the idea is to avoid just null references. As a C# developer, I've noticed most of the C# developers handle string checking for null always. So this feature doesn't seem to be really helpful, rather introduced a confusion. I've seen Null reference exceptions mostly when objects are referred without checking if it's null.
IMO, I may be missing the greatness of this new feature, but this really introduce complexity in understanding what string type is. string basically should accept a "null". Non-nullable string doesn't makes sense.