Hacker News new | past | comments | ask | show | jobs | submit login

What kinds of things have you written in Go, where the language has been a PITA to you?



Data structures usually, If you want to write a linkedhashmap or a dictionary where the keys are autogenerated from the values or any kind of structure not built into the language you are forced to either roll a new structure for each set of types or cast everything to and from (empty)interfaces.

While it's still possible with the casting, it doesn't feel as nice as the rest of the language does.

The other case seems to be any kind of generic pattern with channels, it's possible to build a channel-pair which acts as a single channel with a buffer only bounded by memory, but you can only do it for a single type.

All of these are avoidable or maybe even inadvisable, but it still feels like a hole in the language when you go to do something which is common, useful and trivial in C++/java/C# and you have to use ugly hacks or deal with heavily reduced functionality, especially when the rest of the language is so nice.


A log scanner that does some analytics, a intra-company web service, ported a few Python programs to evaluate the performance, etc.

Copy pasting data structure code to fix for different types feels (and is) bad. Anything involving non DRY code I consider a failure. (Oh, and working with numeric types).


"Well I would write things in Go, but I keep hearing about this generics thing so I'm just going to complain about it instead"


Yes, because nobody both uses a language AND has a legitimate complain against it.

Well, I for one have both. As lots of people. And in fact, it's quite common. Anyone that used a language should be able to tell you several pain points about it. Except if he is in his idiotic "oh, this is so much better than the blub that I used to use, it's perfect" stage.

Have you even read TFA? The guy evaluated the language, done a project with it, and still wants generics.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: