3 ms·
I write in C only when I need to; in my case I have a limited runtime environment available, so I can't use some other language (which I might otherwise prefer)
by teddyh 4y ago
I write in C only when I need to; in my case I have a limited runtime environment available, so I can't use some other language (which I might otherwise prefer) with a larger runtime requirement, and I also already know C, but not C++. Also, none of the libraries I have to use have C++ APIs. Had I already known C++, and if there were C++ APIs available for the libraries I need, then sure, I might have used C++, but as it is, the results (a C++ program but full of C-style programming because of the APIs) would not be worth the effort of learning C++. C++ also imposes a cost; that of reducing possible contributors to those people who already know C++ – knowledge of C is simply more common than C++.
A C++ program which calls nothing but C libraries will not have the “shape” of a C++ program, but essentially the shape and structure of a regular C program. And the small pieces that remain C++-shaped might not be large enough or provide enough architectural benefit for the drawbacks of C++ to be worth it.
(Paraphrased from this thread: https://news.ycombinator.com/item?id=20849570 https://news.ycombinator.com/item?id=20849570)
- pjmlp 4y agoC++ provides lots of safety knobs over raw C, without having to go crazy with language features.