I am a python user so I may not have all the information but why do people and especially big companies still use C instead of C++? Isn't C++ the superset of C so it is supposed to be better? Also OOP is literally booming everywhere while C is still procedural. I don't suppose that there is much speed comprise between the two, so is there a specific reason?
Why would someone use C instead of C++? - Stack Overflow
Why use C instead of C++
Is the C programming language still used? - Software Engineering Stack Exchange
c++ - Why is C language still used? - Stack Overflow
Videos
C string handling is very different than C++ typical string code. Certainly I wouldn't want any C++ string near my drivers!
More specifically, in good, modern C++ you don't really have to understand pointers and handle buffers at low level; but these are basic and crucial skills in device driver code.
Yes, it's possible to write good drivers in C++; but that C++ would really look like C with a few extra features. Most of the C++ library has no place in deviceland.
It could simply be that they do not have a C++ compiler for the platform they are working with... Personally I would always use C++ in preference to C.
I would call my self intermediate in C++ and basic in C. I seriously don’t understand why you would C instead of C++ except if you don’t have access to libraries.
C has the advantage that it is a relatively small language, which makes it easy to implement a C compiler (whereas a C++ compiler is a monster to write), and makes it easier to learn the language. Also see the TIOBE index, according to which C slightly ahead of C++.
In (IMO) decreasing order of justification, C is still used a lot for
Embedded stuff
It's way easier to port a C compiler to a small platform than it is to port a C++ compiler. Also, C advocates claim that C++ "does too much behind their backs". However, IMO that's FUD.Systems programming
Again, that's usually due to claims that it is easier to "know what the compiler is doing". However, many embedded programs would benefit from, e.g., templates and other C++ key features.Open source software
That's mostly an attitude problem, though: OSS has always preferred C over C++ (whereas it's the opposite in large parts of the industry). Torvalds' irrational hatred might actually be the most important reason for this on Linux.
C is used a lot in embedded hardware programming where resources are scarce.
Linux kernel is written in C because, according to Linus Torvalds, C++ is a horrible language.
I've studied C programming basics in school and college, then there are many languages java python etc etc...
Though I'm not working in coding field... out of curiosity, i want to know IS C STILL ALIVE?... if yes can I fresh start a career with it
Since I’ve started exploring C, I’ve realized that many programming languages rely on libraries built using C “bindings.” I know C is fast and simple, so why don’t people just stick to using and improving C instead of creating new languages every couple of years?
C is a popular language but i wanna know why use C now and for what purpose.
Thank you.
I am a python user so I may not have all the information but why do people and especially big companies still use C instead of C++? Isn't C++ the superset of C so it is supposed to be better? Also OOP is literally booming everywhere while C is still procedural. I don't suppose that there is much speed comprise between the two, so is there a specific reason?
My project last week was to write a compiler for the B language, going off of Ken Thompson’s January 1972 description of B. The project was a success but by Friday I had decided that the compiler needed to be slightly extended to make it a 1972-era C compiler instead. The reasons for that are probably quite similar to the reasons that motivated Dennis Ritchie to sufficiently alter B when he implemented the first compiler, that he felt the language needed a new name.
Specifically, B was designed as a word-oriented language, with no support for manipulation of byte quantities. This is not surprising as all of the computers used by Thompson and Ritchie at Bell Labs before the acquisition of the PDP 11/20 were word-oriented machines. Their work on Multics used the GE 645 and the first version of Unix was developed for a PDP-7.
However the PDP 11 was a byte-oriented machine. A PDP 11 implementation of B was produced, but it had two weaknesses. First, although the B compiler produced an executable, the executable consisted of a sort of byte code combined with an interpreter core that executed the byte code (That’s not entirely accurate but close enough). Second, manipulating character data was unwieldy, yet PDP 11 Unix was byte-oriented.
Therefore the main differences between B and the first C were two: C supported the ’char’ type and C was compiled to PDP 11 machine code. If you look at the source code of the 1972 C compiler I linked above, it is almost identical to B code with the exception of the addition of the types ‘char’ and ‘int’ and, as a result, the ability to specify the types of function parameters and automatic variables.** Therefore, I propose that the name ‘C’ for the new language was chosen not (only) because the letter C follows the letter B in the alphabet, but also because C stands for ‘C’har and ‘C’ompiled. Dennis Ritchie does not mention this possibility in his essay on the history of C, but I think it makes sense.
**This also leads to the purpose of the ‘auto’ keyword. In B, every identifier used in a function had to be declared inside the function body as auto, ext(e)rn, or as a label (goto target). The reason for this is that this allowed the (very small) symbol table in the compiler to be completely purged at the beginning of every function. In B, ‘auto’ meant “this identifier is a stack variable, not a global variable and not a label.” When the C compiler stopped purging the symbol table at the beginning of each function definition, and automatic variables could be declared by type, the ‘auto’ keyword became obsolete. That was probably sometime in 1972.