June 20, 2019

Can we ignore C++ programming at all?


The C++ ecosystem was developed for writing software applications under a variety of operating system. Without any doubt, C++ is the best programming language ever invented. It is very fast, is used everywhere and makes software programming easy. At the same time it's possible to overcome the C++ standard. Not with a new paradigm which is C# or D, but with overcoming the idea of programming at all.
C++ can be seen as a lower layer in software development. It is used for creating productive code under a concrete platform. Most software projects are not starting with the programming task itself but with pre-steps called prototyping. Prototyping is the activity done before the code is written in C++.
The best programming language for prototyping is Python. Not because Python is superior to C++, but because it's focused on a different part of the workflow. The migration from a prototype written in Python into a real application written in C++ is trivial. Every programmer can do so, even his knowledge about Python and/or C++ is low. Because it's a trivial task we can ignore it. That means, writing the C++ code is nothing which needs a priority, it can be done at last and without investing too much energy. That means, the C++ language itself becomes a low priority. All the elements of the C++ ecosystem which are the C++17 standard, the compiler suite, the documentation around the libraries are less important. It's nice, that the technology is available but it's not used in daily life.
Somebody may argue, that C++ is very important. Sure, it is important. Like i mentioned in the introduction, C++ is the most efficient and most used programming language in the world. At the same time we should be aware if the task of creating C++ code is a demanding one or not. If no prototype is available written in a scripting language, and no mockup of the GUI is already there, than C++ gets a high priority. Because in the C++ syntax the prototype has to be written. This kind of workflow is a best practice method, because it ignores the importance of a prototype in software development. It assumes, that a new application can be written from scratch without preliminary steps.
The better idea is to give the prototype a higher priority and handle it as a separate project, not done in the C++ ecosystem. And here comes Python into the game. Python is a language for fast prototyping design. It's not possible to write in Python efficient code, because the language isn't compiled and the Python Runtime environment isn't standardized. But for prototyping design Python is great. It is used in competition to other prototyping tools like MS-Excel, Processing or Matlab.
Let us analyze why it's recommended to a create a prototype before the application itself is programmed. Because a prototype can be made with less effort. It is equal to a throw away prototype. The code which was written will not survive longer than one month. The code won't get published, and it won't delivered to the end user. It's an internal design study for imaging the future project.
Creating a prototype with C++ is not very comfortable. In most cases, the programmer gets overwhelmed by the complex C++ standard, doesn't need pointers and finds it compilicated to create a simple GUI interface. The problem is not located in C++ itself, the problem is, that C++ was never invented as a high-level language. The purpose of a C++ compiler is to generate fast machine code which needs a minimum overhead in the RAM and which is able to communicate with the operating system as efficient as possible. The typical C++ program is using low level OS libraries written in C/C++ which makes the executable binary very fast. C++ is the right choice for creating 3d game which provides 300 fps in 4k resolution and spawns itself over many threads as the same time.
The problem is, that in the prototyping steps, such needs are not there. A prototype doesn't has to use the CPU efficient. A prototype has different priorities than a productive program. The main idea is, that the amount of programming is low. The user doesn't want to program many hundred lines, but he likes to create the GUI in under less 10 lines of code. This is not possible with C++.
It's important to know, that the requirements of easy coding and fast binary files contradicts each other. A programming language can either be compiled or interpreted, but it can't be both.

No comments:

Post a Comment