I still find the option of returning null from a method (like, if you didn't find what you're looking for in the database, for example) quite attractive and easy to handle.
I don't think this is being contested by anyone. However, if a method returns a string, I have no choice but to read the documentation or source code to know whether null is a legal return value. The thing I like about nullable references is that string? makes it 100% clear that null can and will happen.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't think this is being contested by anyone. However, if a method returns a
string
, I have no choice but to read the documentation or source code to know whethernull
is a legal return value. The thing I like about nullable references is thatstring?
makes it 100% clear thatnull
can and will happen.