Comment by gentleman11
5 years ago
My c++ code has so many someptr!= null checks it’s not even funny. But js has those same checks. What languages don’t?
5 years ago
My c++ code has so many someptr!= null checks it’s not even funny. But js has those same checks. What languages don’t?
Haskell, Kotlin, Scala 3 (with a compiler flag) will all remove null from the set of values acceptable by type. (There are others as well) So a String can’t be null ever, you have to do ‘Maybe String’, ‘String?’ or ‘String | Null’ as a type respectively. If this is what you are asking.
Also, maybe it's pedantic, but leaving out null checks in js will not result in a seg fault, it will result in an exception.
And that is different how, as far as a sign the programmer didn’t think the code thru and maybe you can get around some security controls?