News for hackers. Stuff that matters.
Re:Linus Torvalds on C++ by Game_Ender on Monday February 27, 2012 @08:49PM (#3641445)
> needs to get the performance gain that C has over C++

With RTTI and Exceptions disabled you should be able to get almost identical performance with C and C++. In some cases C++ compiler has additional information that can allow it to produce faster code as well.

Re:Linus Torvalds on C++ by dedward on Monday February 27, 2012 @09:35PM (#3641603)
Yup, and if you avoid using any of the new language constructs like objects and whatnot that C++ brings and basically stick to standard C, maybe using just a bit of C++ sugar here and htere, true.... but at that point you might as well be using C, and the argument is really moot.
Re:Linus Torvalds on C++ by Game_Ender on Monday February 27, 2012 @11:22PM (#3641869)
You are wrong. Those the only two features that incur any performance penalty for just existing, and even then it's implementation dependent and in some cases can be zero (ie. zero cost exceptions). Other things that are possibly slow, like virtual functions, can be avoided in specific cases when needed. This is similar to many how C projects use structures of functions pointers, for abstraction, but not everywhere (including the Linux kernel).
Re:Linus Torvalds on C++ by cube13 on Monday February 27, 2012 @09:11PM (#3641530)
You also need to not use: STL(most implementations are too slow) Boost or STLPort(namespace and compatability issues if you're not producing executables) Most OO features like inheritance and polymorphism(a lot of that is resolved at runtime, which eats cycles) Function overloading(debatable, since the compiler should resolve the function signatures at compile time)

You're pretty much left with C with namespaces at that point.

Re:Linus Torvalds on C++ by jmccaffrey on Monday February 27, 2012 @09:18PM (#3641550)
C++ actually has some performance advantages over C, especially relating to static polymorphism (qsort v. std::sort)
Re:Linus Torvalds on C++ by aidenn0 on Monday February 27, 2012 @10:34PM (#3641769)
Technically you can do tricks like that with the C preprocessor, though it is a bit ugly and lacks automatic instantiation.
Re:Linus Torvalds on C++ by yannickt on Tuesday February 28, 2012 @01:34AM (#3642159)
It is also not type safe.