Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Bomaz
· 5y ago · 0 comments
not even go developers find the error handling adequate. Since if it was then slice acces would return an error rather than panic.
a,err:=slice[i] ...
Comments
[–]
gnubison
5y ago
Do you also believe that the / operator should return two values, a “primary” result and an error value?
[–]
Bomaz
OP
5y ago
if golang error handling is a good way of handling errors that should be the correct implementation
[–]
philosopher1234
5y ago
Your thinking is too black and white.
[–]
iainmerrick
5y ago
Go isn’t alone there. Swift arrays also raise fatalError on out-of-bounds access by default, which seems incredible in an otherwise “safe” language. It’s easy to write your own accessor that returns an optional, but why isn’t that the default??