3 ms·
C++ code, when sophisticated template meta programming techniques are used, can be as fast as tuned C code, and can beat any language in terms of speed with the
by jbpritts 15y ago
C++ code, when sophisticated template meta programming techniques are used, can be as fast as tuned C code, and can beat any language in terms of speed with the exception of hand-tuned assembly. However, techniques like expression templates, automatic loop unrolling, template specialization, and static polymorphism require a VERY high degree of sophistication from the programmer. In some sense, the programmer is forced to be a compiler. There are some individuals that, despite this demand, can be highly productive. The others wallow in complicated syntax, horrible type errors, and difficult to trace run-time errors. Unless speed is absolutely essential, C++ should be avoided at all costs.
- pnathan 15y agoC++ TMP is quite painful to the uninitiated. Outside of that, C++ is not that bad, especially as you build up your project-specific abstractions.