3 ms·
Generics have their use cases, but in general they are overrated. Especially in (but not limited to) the DevOps area, I bet that 99% of the code needs no generi
by christophberger 9y ago
Generics have their use cases, but in general they are overrated. Especially in (but not limited to) the DevOps area, I bet that 99% of the code needs no generics at all.
Having said that, I would not complain if the concept of Ply (https://github.com/lukechampine/ply https://github.com/lukechampine/ply) becomes part of standard Go.
- BlueMatador 9y agoYou're right. Although a lot of people have written about this limitation in the language. Applied Go has a tutorial on how to use arrays, slices, or maps as a workaround for many generics need cases, much like it looks like Ply does. https://appliedgo.net/generics/ https://appliedgo.net/generics/
- mbarlocker 9y agodepends on what you're trying to do with devops. If you're writing a script, I agree. Use bash anyway, Go probably isn't the thing. If you're writing a modular agent that monitors a running system, then generics would be pretty nice. Ply looks interesting, but still lacking for my particular use case.