←back to thread

257 points pmig | 5 comments | | HN request time: 1.171s | source
Show context
blindriver ◴[] No.43096757[source]
I've been using Go for a while now. The biggest headache is error handling. I don't care what the "experts" say, having exception handling is so, so, so much cleaner in terms of error handling. Checking for err is simply bad, and trickling errors back up the call stack is one of the dumbest experiences in programming I've endured in multi-decades. If they are willing to add generics, they should add exception handling as well.
replies(4): >>43097025 #>>43097105 #>>43097710 #>>43098949 #
codr7 ◴[] No.43097710[source]
Agreed, every time I jump back into Go I'm at first relieved at how nimble it feels; but it never takes long to remember what a pita error handling is or the kludges you need to write to do basic collection transformation pipelines (compared to Java/Streams, C#/LINQ, C++/std etc).
replies(1): >>43098295 #
1. throwaway2037 ◴[] No.43098295[source]

    > or the kludges you need to write to do basic collection transformation pipelines (compared to Java/Streams, C#/LINQ, C++/std etc).
Why hasn't anyone written a good open source for this problem, now that Go has generics?
replies(2): >>43098334 #>>43098457 #
2. codr7 ◴[] No.43098334[source]
Don't know, every time I try to do anything beyond trivial using Go generics I run into some kind of issue. They haven't been around that long, it takes time for ideas to mature.
replies(1): >>43109849 #
3. metaltyphoon ◴[] No.43098457[source]
It seems like the std library has slowly been adding generic iterators methods. Maybe one day?
4. throwaway2037 ◴[] No.43109849[source]

    > anything beyond trivial using Go generics
This is the first complaint that I have heard about Go generics on this board. I believe you. Can you share a specific example? It might spur some interesting discussion.
replies(1): >>43123669 #
5. codr7 ◴[] No.43123669{3}[source]
Haven't written much Go the last year and a half...

Mostly novel limitations that I'm not used to from C++.

Instantiating generic parameter types is one thing I couldn't figure out at some point, but that's pretty much useless in C# and impossible in Java if I remember correctly.

I recognize the frustration from following implementations in both Java and C# though, it takes a while for generics to settle, each implementation has its own quirks.