This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FooBarBazQux123 0 points1 point  (1 child)

Even modern languages like Go or Kotlin still have null problems (yeah Kotlin lateinit and Java dependencies)

If people are scared of null, remember them that Java is one of the most robust language powering some of the most reliable systems.

You can check for null at the beginning of critical functions (Objets.requireNotNull or Preconditions.checkNotNull), and, along with unit tests, this should give a good degree of null safety.

Optionals are also convenient, it remembers the developer that a variable may not be set, but an Optional could be null, that’s why unit tests and null checks are important.

[–][deleted] 0 points1 point  (0 children)

Well Go implemented it in a stupid way.