Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
donkulator2881268dNon-nullable reference types in C# only exist because there is a team somewhere whose job it is to add new features to C#.
-
Lensflare17095268dWait, c# non nullable references can be null? What kind of dogshit is this?
So glad that I use Swift where non-null actually means that it is 100% guaranteed to be not null. And nullables are required to be checked for null. -
C0D468145268dI go to Reddit....
"I don't want to check for nulls"
https://reddit.com/r/salesforce/...
I go to devRant....
"I don't want to check for nulls"
I have a bad feeling about today! -
NoToJavaScript4646268d@Lensflare I do not use Swift, but if allows any kind of reflexion coding, thatn it can NEVER garanty non-null, like ever.
-
NoToJavaScript4646268d@C0D4 My point is , dev should take 5 seconds to write :
var a = objA?.PropertyB?.Id ?? <whatever>
instead of
var a = objA.PropertyB.Id -
C0D468145268d@NoToJavaScript I wasn't having a dig at you, I just came from the same argument else where and found it funny, in the "I'm going to get fucked by a null today ain't I" kind of way.
I agree, if you're working with nulls, protect yourself from them. -
Lensflare17095268d@NoToJavaScript you are wrong. It has reflection and it’s still impossible for non nulls to be null. Because it has a proper type system and is designed that way from the beginning. C# did add it very late in its development.
In Swift, nullability is something you add to a type, not the other way around. -
NoToJavaScript4646267d@Lensflare yes. It will throw exception if non nullable is somehow is null.
That's my point, it doesn't garanti that you will recive object non null, it juste autopate exception
Related Rants
Why do people can't take 5 seconds to do a null check in 99% of the cases ?
"Oh I just assume it cannot be null"
Right, still take fucking 5 seconds to check it.
So tired looking at logs and seeing thousands of "nullpointerexception".
You can literally use it wuith "?" propagation
"But I defined in my coe that variable is never null using c# nullability!"
yeah moron, it makes compilator happy. It does not garanty that your variable will be not null. It wiull throw exception !
Damn.... If I die, my hell will be full of null pionters.
rant
null