Comment by lagichikool

9 months ago

"code blowing up because of this issues"

I ran into these issues all the time with Java, C++, and Python projects.

But it's just not the experience of running Go in production, which I've been doing for over 10 years now, across many projects with many devs.

In practice, nil checks are just not very difficult to include everywhere. And experienced Go programmers don't use exceptions (panic/recover) almost ever.

What you said is:

1) Anecdotal

2) Based on faith that someone will not forget to do something instead of a well documented mechanism in the language that could block that from the start

Having nil/null to handle empty references is simply very bad design and there's decades of examples why. The correct way is using a two-value type like Option, Maybe, etc. so that the (possibility) of the value missing is actually encoded in the type system