Re:The practice of programming, 18 years later
by eropple on Saturday January 21, 2017 @03:48PM
(#13452059)
> The lack of generics is annoying when you come across it, but it's relatively rare to come across. The seemingly foot-shooting flexibility of interface{} and Value are frightening from afar, but seem to "just work" when you use them in practice.
...Unless you write code that treats types as things, and not as inconveniencies that the compiler foists upon you. At which point the problems of generics appear immediately.
Like, I'm glad it works for you (well, sort of--the more Go in the world, the more likelihood that I'm going to have to deal with it), but what you're describing really only works from one very particular mindset of software development that isn't super well-shared.
> Error handling is still a bit of a pain, but I do appreciate being forced to think about error handling, instead of just relying on a global try/catch and runtime tracebacks.
Go's method of "making you think about error handling" is not just "a bit of a pain" but really, really weak, though, and it ties back to the language itself not being particularly expressive. In a language with expressive generics, you just fold() across anything that can return an error because it returns Result<V, E> and you must handle both cases inline.
...Unless you write code that treats types as things, and not as inconveniencies that the compiler foists upon you. At which point the problems of generics appear immediately.
Like, I'm glad it works for you (well, sort of--the more Go in the world, the more likelihood that I'm going to have to deal with it), but what you're describing really only works from one very particular mindset of software development that isn't super well-shared.
> Error handling is still a bit of a pain, but I do appreciate being forced to think about error handling, instead of just relying on a global try/catch and runtime tracebacks.
Go's method of "making you think about error handling" is not just "a bit of a pain" but really, really weak, though, and it ties back to the language itself not being particularly expressive. In a language with expressive generics, you just fold() across anything that can return an error because it returns Result<V, E> and you must handle both cases inline.