3 ms·
People write C in C++ because they don't actually know C++ and think it's "basically C with classes and strings". There are legitimate reasons why someone woul
by qsort 4y ago
People write C in C++ because they don't actually know C++ and think it's "basically C with classes and strings".
There are legitimate reasons why someone would rather write C, but "I don't understand RAII" is not one of them.
- owlbite 4y agoC with basic templates is normally what I want. Occasionally other C++-isms drift in, but normally to the harm of the code quality.
- wruza 4y agoC++ doesn’t require you to commit to all of its features and/or paradigms. Using it as you see fit is valid. Just don’t advertise yourself as a C++ programmer to the job market, as it’s not what most people expect. There’s nothing wrong with “C with classes and strings” idea by itself, if that is your choice or a consciously sufficient level of competence.
- qsort 4y agoIt doesn't require you to commit to all of its features, that's certainly correct. But it does require you to commit to its principles; if you're needlessly passing naked pointers around, you're really writing C code with a C++ compiler.
- wruza 4y agoI don’t see how it requires you to commit to any principles, if you can avoid those you don’t need and still successfully compile. That’s called “suggests” or “allows”, not “requires”. Yes, some people are writing C code with classes and strings in C++. That’s why we call this mode “C with classes and strings”. I believe that you are attached to these principles (see their benefits), and that is fine. But not everybody likes full-on C++.