|
|
|
|
|
by diarrhea
633 days ago
|
|
Your first paragraph is a great description of what I am currently feeling as well. There just isn’t anything there. I’m familiar with Python, Rust, C# and other random languages. Go just has nothing to offer meanwhile. I am struggling with nil and zero values every day, the lack of enums, and the bizarre error handling (wrapping etc.). I’m waiting for it to click but nothing yet. Channels in combination with effortless (uncolored) asynchrony are maybe it. I haven’t reached that point yet though as I’m still struggling with just expressing my domain, without having invalid and primitive values, constructed and passed around by design, all over. I suppose it is not possible. Every time I see “url string” in a function or struct I die a little inside. |
|
But it puts me in this mode where I occasionally want to write a function which doesn't return an err, and I think it ought to be doable, because I've declared a type for this string and I happen to know it's only one of three values, but then the lack of enums means that the type checker doesn't know that it's one of those three values so I've got all this extra runtime code for checking against error cases which could've been caught at compile time.
I think you're right that the concurrency story is the key to making it feel real: go routines, channels, etc. I haven't had occasion to use those things yet though, so it's pretty bland so far. When I hear people talk about them though it seems like they'd be better served by Erlang and have just settled for Go because it's popular.