October 21, 2022

Tribute to Ansi C

 

The C90 Ansi C standard is a great choice for programming. The language was invented 40 years ago and outperforms every modern language easily. C compilers are available for all computers and all operating systems and allow to write any sort of software. No matter if C is used to create videogames, webapplications, desktop apps or even operating systems libraries — c is always a great tool.
Every criticism against the c language is a sign for a misunderstand what programming is about. Programming is not about drag and drop GUI widgets into a frame and press a run button. Programming is not about importing a python library without understanding what the inner working is. But software engineering is about understanding from a low level perspective what the computer is doing internally. This includes to use raw pointers with direct memory access to compare two strings, and write sorting algorithms from scratch because they are missing in the standard C library. This is not problem, but is ensures that programming makes fun.
So called high level languages like Java or PHP are created by inexperienced programmers for non programmers and are a sign of failure. The best recommendation is to rewrite all these existing nonsons programs with Ansi C and create new software always in C as well. Only a compiled language can be executed fast enough and it is simply not true that the productivity in scripting languages is higher than in C. Most libraries are not needed in the reality. For example the matplot library which allows python programmers to draw charts can be simply emulated with a c program which draws the graphics into the video ram of the graphics ram. The underlying algorithm can be written from scratch in a short amount of time and is more cpu efficient than any precompiled library.
Object orientation which has become famous since the 1990s is a dead end because Ansi C has a more powerful feature called modules which allows to interconnect different programs into larger systems. There is no need to create complex C++ compilers or even invent jit compilers to execute PHP, but the same task can be realized with a vanilla C compiler much easier. Basically spoken, all these java programmers are wasting their time, if they are writing the software in so called high level languages. They have simply not understood what a linked list is or what the C preprocessor is doing internally.
With the c language everything is great, but the ecosystem around C has made major mistakes. In the last 20 years lots of new programming languages were invented with the promise to make programming easier to learn. Non of these attempts was able to replace the c language. Buzzwords like agile programming and object orientation were mostly invented by c programmers and can't be replicated in other programming languages. a well trained C programmer is able to write any sort of applications within a week. All what he needs is a VIM editor plus the gcc compiler and the c internal features are producing error free code by itself. The resulting binary file will run on a server and a desktop very well and it is unlikely that the code needs to be improved. And if another programmer will find an error, he can easily locate the error because the program is divided into smaller chunks. Ansi C has a natural tendency to evolve into stable software projects which are written once and then used as production ready code for decades. The C language stands for high software quality and maximum coding productivity.
One of the strength of C is string handling. There are more than 12 different ways available how to concat two strings together.[1] it is recommended to decide for one of them and the program will be protected against all sort of security issues.
[1] https://stackoverflow.com/questions/8465006/how-do-i-concatenate-two-strings-in-c