5 ms·
C has macros handled by C compilers, no need to hack templates with third party pre-processors like Go gen. You can't even compare C and Go in that case. In fac
by camus2 10y ago
C has macros handled by C compilers, no need to hack templates with third party pre-processors like Go gen. You can't even compare C and Go in that case. In fact C is more expressive and type safe than Go.
- pjmlp 10y agoIt worked so well that C11 now supports a kind of lite generics. http://en.cppreference.com/w/c/language/generic http://en.cppreference.com/w/c/language/generic
- solidsnack9000 10y agoC macros are not hygienic, which is one motivation for C++ templates. I agree with what you're saying about the pre-processor being part of the standard but it's really hard to write those things in a way that is safe. There were many motivations for C++ -- and many more seemed to get added as it went along -- it's not just generics parametric polymorphism. Of course I would hate to say: Go should have every language feature or else we'll end up with Go++ or Objective-Go or something like that. But simplicity is not just a matter of not providing for something.