|
|
|
|
|
by aikah
3524 days ago
|
|
> What about the way Go handles errors today makes them not "strongly typed"? Error as type or error as values ? the std lib promotes error as values (i.e. check equality) instead of errors as type (i.e. check the type). Go error system WAS written with errors as value in mind. There is no point having errors in place of exceptions if errors were intended to be used as types (which they are not, as said previoulsy). Basically developers are implementing their own mediocre exception system on top of Go errors. The error as value thing made sense in C 30 years ago, it doesn't in a language created less than 10 years ago. There are a lot of C inspired patterns in Go that make the language half modern/ half dated in strange ways. That's fine when one comes from C though, that isn't when one comes from anything remotely modern. But I guess it's why Go is successful, it's basically C with garbage collection. |
|