Comment

Comment by geenat

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

- 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..

parent geenat 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton