4 ms·
Would love to use more golang- amazing build system and cross compiler built in. "All in one" binaries are the best thing ever. I adore most of the ideas in the
by geenat 3y ago
Would love to use more golang- amazing build system and cross compiler built in. "All in one" binaries are the best thing ever. I adore most of the ideas in the language.
.... but there are just soooo many little annoyances / inconveniences which turn me off.
- No Optional Parameters. No Named Parameters. Throw us a bone Rob Pike, it's 2023. Type inferred composite literals may be an OK compromise.. if we ever see them: https://github.com/golang/go/issues/12854 https://github.com/golang/go/issues/12854
- Unused import = will not compile. Unused variable = Will not compile. Give us the ability to turn off the warning.
- No null safe or nullish coalescing operator. (? in rust, ?? in php, etc.)
- Verbosity of if err != nil { return err; }
- A ternary operator would be nice, and could bring if err != nil to 1 line.
- No double declarations. “no new variables on left side of :=” .. For some odd reason “err” is OK here... Would be highly convenient for pipelines, so each result doesn't need to be uniquely named.
I'd describe Go as a "simple" language- Not an "easy" language. 1-2 lines in Python is going to be 5-10 lines in golang.
Note: Nim has most of these..
- skybrian 3y agoHave you tried Deno?
- myzie 3y agoAgreed! Shameless plug: this is why I built Risor. https://github.com/risor-io/risor https://github.com/risor-io/risor Keep in the Go ecosystem, retain compatibility with the Go programs you already have, but have a much more concise scripting capability at your disposal.
- geenat 3y agoLooks more useful than OP.
- IshKebab 3y agoI agree. Go has such amazing infrastructure it's a huge shame the language is so stubbornly basic.
- _0w8t 3y agoThe error handling verbosity in Go should be blamed partially on the formatter that replaces one-liner if err != nil { return err } with 3 lines.