4 ms·
Yes who needs generics and a proper error handling system. When you can have Go where the boilerplate is so bad you literally have to rely on generating source
by threeseed 2y ago
Yes who needs generics and a proper error handling system.
When you can have Go where the boilerplate is so bad you literally have to rely on generating source code files in order to maintain a sane level of productivity.
I use idiomatic Go every day and it's like being back in the 90s.
- zwnow 2y agoIts actually a good question on who needs generics. It makes code unreadable and was never really useful in commercial products.
- BreakfastB0b 2y agoTry writing Go without generics. No typed maps, arrays, slices, channels or function types. Only `interface{}`. Go always had generics, you just weren’t allowed to write your own until recently.
- Hendrikto 2y agoYou use it everyday, yet have not figured out that it has had generics for almost 3 years?
- retrodaredevil 2y agoIts generics aren't as advanced as Java's or any other language with generics for that matter. Plus most things are now only adding support for generics, so there's a fragmented ecosystem of code before and after generics were introduced.
- erik_seaberg 2y agoThis. It's so frustrating that sync.Map isn't generic and reusing the builtin map API is impossible.
- kgeist 2y agoIn our entire codebase, Go's generics have been used, like, 3 times, even though they were introduced almost 3 years ago. It's unsurprising: generics are most useful for writing your own custom containers, and generally, most projects don't need their own custom containers. It felt somewhat anticlimactic, considering all the anticipation.
- therealdrag0 2y agoYou often don’t need custom containers, but you need containers! I shouldn’t have to write my own custom method to map or for each over a list of items, etc.