Re:Building Web Apps in Go
by danieldk on Monday March 28, 2016 @10:03AM
(#11374299)
Any time a low level method changes to throw a new exception,
You don't do that in API-stable code, period. If you are working with API-unstable code - that's the point of static typing. The code won't compile because the intention is exactly to signal that something has changed.
If you change the return type of a low-level Go function, you will have to modify its callers as well.
Anything anywhere near the application logic just threw our top level generic exception,
Bad codebase = bad. Sure. I never encountered that problem in the Java codebases I worked on at various employers. (And I'd be quite happy to complain about Java, I don't like it.)
It's really not that easy to ignore errors in Go in practice...
It is. The compiler will not emit a warning when you ignore the return value of a function/method. Here:
fmt.Println("Hello world")
I have just ignored an error. The compiler is happy. There are quite some Go packages in the wild that do not deal with errors when they need to.
You don't do that in API-stable code, period. If you are working with API-unstable code - that's the point of static typing. The code won't compile because the intention is exactly to signal that something has changed.
If you change the return type of a low-level Go function, you will have to modify its callers as well.
Anything anywhere near the application logic just threw our top level generic exception,
Bad codebase = bad. Sure. I never encountered that problem in the Java codebases I worked on at various employers. (And I'd be quite happy to complain about Java, I don't like it.)
It's really not that easy to ignore errors in Go in practice...
It is. The compiler will not emit a warning when you ignore the return value of a function/method. Here:
I have just ignored an error. The compiler is happy. There are quite some Go packages in the wild that do not deal with errors when they need to.