3 ms·
I love-hate C++ templates because deep down they are just macros and you don't have to obsess about constraints like in Java and C#. To me it's pretty interest
by zwieback 6y ago
I love-hate C++ templates because deep down they are just macros and you don't have to obsess about constraints like in Java and C#.
To me it's pretty interesting how the three big static OO languages have implemented generics: super flexible permissive macros in C++ (with murderous error messages), type erasure in Java (gross) and actual generics in the runtime (C#). For everyday usage it doesn't matter much but I always like thinking about what's going on under the hood.
- kaba0 6y agoThis is my usual nitpick, but pretty much every language does type erasure and there is nothing bad with it, blahblah. Haskell is arguably great with types, and it does type erasure as well.