Back

crufter.com

About János Dobronszki

Updated 8/14/2024
http://crufter.com/everyday-hassles-in-go

### Lack of generics Generics are well supported by a wide range of languages, and is one of the most requested lacking features of Go. The usual response from the Go authors is that implementing generics will either slow down compilation, the code, or the programmer. While that is almost a believable reason, the funnier part of their reasoning is (excerpt from FAQ): … #### Flow disruption Perhaps the most elusive, but rather destructive aspect of the lack of generics in Go is how the language forces the user to go into uninteresting details while expressing ideas, disrupting the programmer’s flow. We don’t have to venture far to see examples of this - we can stay at the topic of list operations, as we did in the previous example. … #### Lack of deriving Default implementations for certain interfaces should be provided. How can Go print out our structs or maps correctly? We don’t know. It is done with reflection, which is runtime concept and sidesteps the type system entirely. The ad hoc, edge case laden nature of Go shows here again. For those who are unfamiliar with the concept: … ### Other minor annoyances #### General inelegance ##### Superflous syntax Almost everywhere superflous brackets of all types can be found. What is the purpose of: vs (hypothetical Haskell equivalent) ? Go got rid of some of these (for loop, if requires no parentheses), but there are still plenty. ##### Operators should be functions The only reason operators are not functions is because the type system is not sophisticated enough to describe them.

Related Pain Points3