Sometimes, the C language was described as outdated. The syntax was invented 50 years ago and lots of other programming language are available. At the same time, lots of sourcecode was written in C and will be written in the future. How fits this together?
To understand the success of C we have to look what will happen after a potential alternative was invented. Suppose, somebody has created a new programming language, for example Rust. The first thing after the specification and the compiler was created is, that the community will create a large amount of libraries in that language. A library for graphics output, encryption and file access makes programming much easier. And every programming language needs such libraries. There are even libraries available for the x86 assembly language. The idea is, that the programmer is using this libraries in their own project and improves the overall productivity.
The interesting point is, that these libraries are looking very similar in all the language. A library written in C has the same documentation like the same library written for Rust. Usually a library consists of subfunctions and newly invented datatypes and the programmer has to read the manual to understand the usage. The power of programming language comes not from the ocmpiler nor the syntax, but how easy it is to write libraries. And this directs us to the explanation why C is used since decades for writing software. Because C makes it easy to create libraries.
The funny thing is, that until now, nobody has made a recommendation how to improve the library concept of C. In a direct comparison with a more recent language shows, that C libraries are created the same. If a programming language provides the ability to create libraries and has a reasonable fast compiler the success is available for sure.
The funny thing is, that even we would ignore C and program software in a different language. After a while the new programming language would like C. The reason is, that all the programmer would port their C libraries to the new programming language and then the situation is the same. That means, there are hundred of pre compiled libraries which can be included in the own program and with a bit trial and error it's possible to create applications and games in that language.
No comments:
Post a Comment