The C++ programming language is the best technique in implementing modern software. It’s a great choice for Linux, Windows and Mac OS X. The main reason, why C++ is superior to Python, golang, Java, and C# is it’s performance. No other language can provide the same speed, and C++ compiler are the most professional available. If a modern software project provides precompiled binaries for all the major operating systems it is the best practice method in deploying software for production environment. That means, the enduser won’t have much trouble in running a .exe file which was created by a C++ compiler on his operating system.
The only problem with C++ is, that most beginners finds it hard to master. The language provides a large amount of features. Let us first describe a situation, which can be handled very well with the C++ programming language. Suppose, the programmer has already a prototype written in the Python language. It’s a simple pong game. The task is now to convert this prototype from Python to C++. That means, to rewrite the sourcecode in C++ and optimize the sourcecode for maximum speed. How hard is this task? Not that great. It’s a C++ only programming task. That means, how the software will looks like is defined in advance, all the classes are known thanks to the Python prototype. And the C++ programmer has only to write the sourcecode itself, which is using the latest C++ features. Then he compiles the project into a binary file and the game will run great.
The amount of needed manpower for such a conversation task is also very low. A single programmer can do so. Even his knowledge about C++ itself is low, he will find in the internet all the ingredients he needs. If he runs into trouble with pointers, he will find the answer too and at the end, the programmer will notice, that pointers are easier than expected and they improve the stability of the code very much.
Most C++ programming projects doesn’t start on top of existing prototypes written in Python and this is the reason, why C++ is sometimes called problematic. If C++ is utilized for creating a prototype, it’s indeed a Honorable language. Because the programmer is not allowed to make single mistake. The syntax must be perfect, and it’s hard to try out new ideas. Using C++ as a prototyping language and communicating the results with other developers is some kind of antipattern. That means, the developer will waste his time with complicated C++ syntax and the project will take months and years without any results. Before somebody can write C++ code, he needs the program first. That means, the class diagram, the documentation, the requirements, the GUI layout, the sprites, the backgrounds, the music and the concept of the game should everything be ready. C++ is only used for creating the final binary. That is a large .exe file / package which will run with maximum speed in a production environment.
The difference between production software and prototyping software is not made clear in the past. The reason was, that most projects in the 1980s were small in size. If the software contains of less than 1000 lines of code, there is need for a dedicated throwaway prototype. Instead, the programmer can write the code from scratch in the C++ language. Such kind of small projects are no longer available. Professional software development requires at least two steps: prototyping design, and programming itself. For that last step, programming itself, C++ is great, because it’s a combination of a compiled language which provides object-orientation. No other language can offer this mixture. Such a combination is important if the project is larger, for example a desktop application, and the binary file should run as fast as possible. Avoiding object-orientation and fallback to plain C isn’t an option, especially not for GUI development. And not using a compiled language and creating a production ready software with Python is also an antipattern, because the Python VM is slow, doesn’t supports pointers and the threading isn’t stable.
What is important to know, that C++ should only be used in the programming step and not for the whole software engineering workflow. Everything which is done before the programming itself, can be created with other tools, which are better suited than C++. For example with graphical UML design tools and with interpreted toy-languages like Python, Matlab and PHP.
Example As a practical example, let us take a look at a Python prototype on Rosettacode. The problem of finding prime numbers can be solved with the Eratosthenes. The Sourcecode for the algorithm is given here https://rosettacode.org/wiki/Sieve_of_Eratosthenes#Python The code has one advantage and one disadvantage. The pro is, that the code is easy to read, the con is, that the Python code will run very slow and can’t be made faster. We are taking this Python prototype and write the same algorithm again in C++. This task is surprisingly easy. We can use the full power of a compiled object-oriented language and the code will run at least 10x faster than the Python original.
Such kind of conversation step is recommended for all projects. At first, some kind of pre-step is needed, which is often equal to a Python program which runs reasonable well but lacks in terms of professionalism. Then this sourcecode is converted into the C++ syntax and will result into maximum performance on any computer architecture.
This strategy provides the following advantages: it reduces the invested manyears, it provides the maximum speed of C++, it is beginner friendly.