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.

A comic book.

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 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.

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?

Example code