5 ms·
I think I'm misunderstanding, but doesn't Java and C# allow you to pass null in the place of an object?
by ramenmeal 8y ago
I think I'm misunderstanding, but doesn't Java and C# allow you to pass null in the place of an object?
- chmln 8y agoYes, I know Java for sure allows this. There are workarounds to enforce stricter behavior via things like @NonNull and checker frameworks, but it obviously never works as well as it would on a language level.
- saagarjha 8y agoThey do, and this has largely been regarded as a hole in the type system.
- pjmlp 8y agoYes, but they are 20 years older than Go. C# 8 will fix this by switching defaults (opt-in due to backwards compatibility), and Java has type annotations since ages. Hence why it feels wrong to a new kid on the block to ignore what the language community at large already agreed were design errors.
- snaky 8y agoMaybe there's some pattern here "By 1960, we had a long list of amazing languages: Lisp, APL, Fortran, COBOL, Algol 60. These are higher-level than C. We have seriously regressed, since C developed" - Fran Allen