Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

19
  • 5
    I only consider C++ because of STL. Commented Dec 22, 2010 at 16:29
  • 47
    So something that can be done using C, perl and python together can be done using C++ only. And you are asking why to use C++? Commented Dec 23, 2010 at 5:37
  • 39
    « When I'm going to performance, the first and last choice is C. » yeah sure :D This is an unproven, and trivially wrong assertion. Commented Aug 2, 2011 at 17:06
  • 16
    @deadalnix: I wouldn't say that. C++ has complex rules that might backfire on optimizer, because it's not allowed to do some things. And it's super easy to step into invisible performance killers. It's pretty much axiomatic, and therefore true :D Still in reality C++ code will sometimes be faster because you'll be using more effective algorithms and data structures, and noone actually optimizes C code anyway. So when done correctly, C++ is safer and more effective C, and you should pick C++ over C when there are no compatibility problems, or requirement for 100% availability software. Commented Dec 18, 2011 at 21:43
  • 4
    The best reason, not considered in the posted answers, directly relates to OP's question. DEPENDANCIES!!!!, Not that your average system lacks the c++ libs, but an embedded system might not have them available. The only way to to get your program in every system, is to write your program in regular C. Everything else is just debating why you should, or less represented, should not use C++. None of that addresses why C++ is not used more often, and regardless of merit, the reason is dependencies.... O and also Linus's famous c++ rant. Commented Apr 2, 2013 at 22:01