|
|
|
|
|
by jephir
4258 days ago
|
|
Go still has some unecessary sources of complexity, for example: 1. It uses null (the billion-dollar mistake) to indicate optional values. A better designed language uses an option type. 2. It has conflicting idioms for conditions. Error types use the `if err != nil` idiom while map access uses the `if ok` idiom. This means that you read the main execution path downwards and the error path to the right, unless you access a map, then the execution path goes to the right and the error path goes downwards. 3. The `:=` operator declares new variables, unless you use it to declare multiple variables where one already exists in the same scope. As a result, you don't know if you have actually declared a new variable using `:=` unless you read upwards to see if a declaration for the same variable name already exists. |
|