Hacker News new | ask | show | jobs
by The_Colonel 1045 days ago
> Why go learn another language and ecosystem when the things it brings to the table are of no value _to me_ ?

The language is conceptually very similar and ecosystem is shared to a large degree.

> I honestly do not struggle with null. If you actually read the code you call and test the code you write you won't have a problem.

Looks like you work on small projects only. If you can just read the code you call, then you don't need much of a type system at all.

In my case, the call I make often executes 10,000s of lines of code and figuring out if it can return null in some cases can take hours or days.

2 comments

> Looks like you work on small projects only.

Don’t be dismissive. I could easily just say “looks like you’re just a bad dev if you can’t handle null.”

I work on large code bases too. There’s nothing special about them.

It's very hard to take you seriously if your argument is "just read the code you call to figure out if it returns null or not". That just isn't feasible in large code bases.
It sounds like badly documented code then. A function, especially if some kind of API boundary, should absolutely state whether it can or can’t return null.

Ideally everything should be non-nullable, with optionally specified nullability.

> It sounds like badly documented code then. A function, especially if some kind of API boundary, should absolutely state whether it can or can’t return null.

Of course, in the type system.

Just like we're "documenting" types themselves in the type system and not in JavaDocs.