| ▲ | odo1242 10 hours ago | |
For me it's mainly the if err != nil {} stuff and the fact that everything is package scoped (C-style enums and constants). You can pretty clearly see the limitations if you read, for example, the type of code the Protobuf compiler generates when trying to compile Protobuf/gRPC enums or structs into the way-more-limited Golang type system (this is despite the two being designed to work together). And it could really do with algerbraic data types and other modern programming language features. Also the type system does have a couple weird behaviors that seem straight out of JavaScript. Like the difference between struct and interface nil for example: ``` var buf *bytes.Buffer = nil var out io.Writer = buf // now out is nil if out != nil {
}``` Many things about the language almost seem to be designed to simplify the implementation of the compiler rather than to benefit the developer experience. | ||