4 ms·
> You can go way overboard with templates/macros/traits/generics. You can go overboard on any language concept imaginable, but conflating all these mechanisms
by throwaway27448 8mo ago
> You can go way overboard with templates/macros/traits/generics.
You can go overboard on any language concept imaginable, but conflating all these mechanisms makes it sound like you haven't interacted much with non-C++ languages—particularly since rust doesn't have templates or anything like templates, traits are an entirely unrelated composition mechanism, and macros are entirely unrelated to the type discussion in the article.
This isn't really "advanced type theory" so much as picking up programming language developments from the 90s. I suppose it's "advanced" in the sense that it's a proper type system and not a glorified macro ala templating, but how is that a bad thing?
- Cpoll 8mo agoAgreed. Generics are in most modern typed languages, and traits are essentially interfaces. Maybe templates means C++ templates, which are essentially generics?
- mihaelm 8mo agoMy guess is they meant metaprogramming in general (templates/generics, macros), but traits are not quite like the others.
- nesarkvechnep 8mo agoIn C++, concepts are essentially generics where templates are more like weird macros.