Orthodox C++
This translation is fromhttps://gist.github.com/bkaradzic/2e39896bc7d8c34e042bThe original author is...Бранимир Караџић.
What's Orthodox C++?
Orthodox C++ (sometimes called C+ It is the most important set of C++s, which improves C, but avoids all the unnecessary in the so-called modern C++s. It's with Modern C++The preset is the opposite.
Why deny the modern C++?
In late 1990, we were also the modern C++ tide, and we used the latest functionality. We tell you that these are the characteristics that should be used. Over time, we have come to understand that the use of some of the language characteristics is not necessary, and it is clear that the characteristics we use have proven to be bad (like RTTI, anomalies and currents) and have been counterproductive by not having the necessary complexity of the code. If you think it's nonsense, wait a few more years.You'll hate the C++ of modern times, too."Why don't I take time to study modern C++" by LinkedIn.

Why use Orthodox C++?
Codes based on the Orthodox C++ limit will be easier to understand, simpler and can be constructed from older compilers. Projects prepared with the Orthodox C++ subset will be more easily accepted by other C++ projects because the subset used by Orthodox C++ will not conflict with the user's C++ subset preferences.
Hello World by Orthodox C++
#include <stdio.h>
int main()
{
printf("hello, world\n");
return 0;
}
What should I use?
- The C++ for category C is a good start and, if the code does not require more complexity, it does not add unnecessary C++ complexity. In general, codes should be readable for those who know the C language.
- Don't do it.This., Orthodox C++ "Design principles" should be closely followed by "simplified and available. EOF”.
- Do Not Use Unusual.
The only C++ language feature that requires the support of a complex running-time system is the only C++ feature that even if you do not have to pay for running-time consumption - in many cases it adds additional hidden codes to the structure, resolution and entry/exit of the try block of each object, and always significantly limits the optimization that the compiler can do. However, the anomaly of C++ is that the compilation period is not enforced, so you don't even know if you've forgotten to deal with some mistakes! In style, error-processing anomalies do not match C's error-return code style, which leads to a real split in programming style, because the C++ code necessarily calls the bottom C library.
- Don't use RTTI.
- Do not use C running time packaged with C++, including ()
<cstdio>、<cmath>Wait, use C-Run-time (<stdio.h>、<math.h>Wait. - Do Not Use Streams
<iostream>、<stringstream>) Replace with a printf-style function. - Do not use any memory allocated by STL unless you do not care about memory management. For more details.CppCon 2015: std: allocator belongs to distribution and std: vector falls to fixation (Andrei Alexandreescu)This is a lecture for more information.
- Don't overuse the meta-program for academic masturbation. To be proportionate, it is used only when necessary, when it is possible to reduce the complexity of the code.
- For the current standard C++<年份>Any features introduced therein should be vigilant, preferably until they are improved in the next iterative period of the standard. For example, “constexpr” in C++ 11 is to be used in C++14.From Jason Turner., cppbestpractices.com stationmaster)
Use modern C++<年份>Are the functions still safe?
Delays in the application of the C++ standard due to the compiler, the distribution of the operating system, etc. Often, new and useful linguistic features cannot be immediately introduced. The general guidance is that if this is the year C++year+5, it can start safely. Selective. Use the C++-year _ characteristic. For example, if the standard is C++11, this year > = 2016, it is basically safe. If the standard required to compile your code is C++17 and this year is 2016, it is clear that you are working on the CVD methodology. If you're doing open-source projects, then you're not building what people can use.
Update As of 14 January 2019, the Orthododox C++ Committee had approved the use of C++14.
And other similar ideas?
- Embedded C++
- Nominal C++
- Sane C++
- Why should your C++ be simpler?
- C++, not you. It's me.
- Alexander Radchenko's C++ party in Sydney.
- A C++ dialect
Example code
- Any C-source code passed by the C++ compiler
- DOOM 3 BFG
- Qt (Use no RTTI, no abnormal construction)
- dear imgui
- bgfx
- TheForge
- Oryol
- Network Next SDK