3 ms·
Codegen is a super flexible and versatile tool, and simply having a strong generics feature does not mean you can avoid it: at $DAYJOB we use codegen even for C
by mappu 5y ago
Codegen is a super flexible and versatile tool, and simply having a strong generics feature does not mean you can avoid it: at $DAYJOB we use codegen even for C++ for e.g. grpc/openapi types, generating rapidjson streaming unmarshallers, etc not even counting Qt's moc/uic.
- EdwardDiego 5y agoI understand and agree, I've run many a Java project that used codegen to emit Protobuf/Avro IDLs as types. But Go having actual generics, and accordingly removing some need for codegen, is not a bad thing at all.
- Cthulhu_ 5y agoNo, I do believe Go will be improved if it allows library maintainers to implement some things like new collection types and utilities using generics. I for one won't be using more advanced functional coding though, it's a lot more difficult to read / parse and the language is not designed with functional programming in mind. I'm sure people are already working on a functional programming library so you can do map / reduce / filter and the like, but readability and performance will be dreadful.
- gpderetta 5y agoStrongly agree. Some people like to be on this endless treadmill of cutting edge features, like in this case parametric polymorphism but I refuse to be dragged in. They just make the code more complex with no benefit. Next thing you know they will try to force me into structured programming (I'm sure there are people already working on do...while). They can pry goto from my dead cold hands.
- EdwardDiego 5y agoLook, I'd just kill for a generic Set, tbh.