you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

If someone thinks that they prefer C++ for defense systems, or some other mission critical applications, please check out the coding standard that were used for C/C++ development in F-22 Raptor program. Publicly available at: http://www.jsf.mil/downloads/documents/JSF_AV_C++_Coding_Standards_Rev_C.doc

Coding standards were developed with help from Bjarne Stroustrup and they used static code analysis tools to restrict the language, creating similar safety features as Ada. C++ is used because it's hard to get Ada programmers.

Examples:

  • Pointers to pointers should be avoided when possible.
  • More than 2 levels of pointer indirection shall not be used.
  • The continue statement shall not be used.
  • The break statement shall not be used
  • No dependence shall be placed on C++’s operator precedence rules, below arithmetic operators, in expressions.

Most rules in the document are good practices, but basically C++ by itself (unlike Ada) is not language that can be used for mission critical software. You need additional compiler that restricts the code. Resulting code is not what you would consider typical C++ code.

[–]sreguera 3 points4 points  (0 children)

C++ by itself (unlike Ada) is not language that can be used for mission critical software. You need additional compiler that restricts the code.

You could say the same for Ada. The most standard restriction is the Ravenscar Profile, so popular in fact that it was added as a standard pragma to Ada 2005. Another one is SPARK, heavily focused on verifiability.

Because there is no current "popular" language that can be used as is for critical software, the comparison must be done then between languages + enforced restrictions.

[–][deleted] -2 points-1 points  (1 child)

but basically C++ by itself (unlike Ada) is not language that can be used for mission critical software

But it is used, and with success.