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.

  • 1
    Non-nullable reference types in C# only exist because there is a team somewhere whose job it is to add new features to C#.
  • 2
    Wait, 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.
  • 1
    I go to Reddit....
    "I don't want to check for nulls"

    I go to devRant....
    "I don't want to check for nulls"

    I have a bad feeling about today!
  • 0
    @Lensflare I do not use Swift, but if allows any kind of reflexion coding, thatn it can NEVER garanty non-null, like ever.
  • 2
    @C0D4 My point is , dev should take 5 seconds to write :

    var a = objA?.PropertyB?.Id ?? <whatever>

    instead of

    var a = objA.PropertyB.Id
  • 0
    @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.
  • 0
    @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.
  • 0
  • 0
    @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
Add Comment