Hacker News new | ask | show | jobs
by ilyt 1073 days ago
Lack of sum types and thus impossibility of just having Result<T,E>-like type for returning errors is bigger one for me, I didn't get bitten by nulls all that much in Go

Although I guess that feeds into eachother, sum types would eliminate any need for null types in the first place.

2 comments

I would have taken sum types over generics, personally. It kinda sucks because you can't create something like Rust's `?` operator without them or making serious kludgy compromises.
Yes, sum types would solve the problem - you are both identifying the same issue imo