> It's not a technical problem, but a social problem. Yes, I would definitely prefer the c++ RAII (and refcounts would be nice too). If you say 'my project is in c++', that sends a certain message to prospective contributors, about what your priorities and ideals are. It can attract certain kinds of contributors and discourage others. Then you have the problem of how to define your subset of c++. It's easy to say 'no exceptions, no RTTI, no STL'. But there are subtler things. As you mention, templates are occasionally useful. But sometimes they're completely superfluous. Do you allow virtual functions? Multiple inheritance? The answer is almost invariably 'maybe'; you have to exercise taste. I can do that by myself, for my own project. But if I want to be able to accept contributions from others, I need a clearer set of contribution guidelines than 'wherever my whimsy takes me', and for such a purpose 'whatever the c compiler accepts' is the best I can do.
> Also, tcc is about 10x faster than gcc and clang, which makes development a joy.
1: https://www.reddit.com/r/programming/comments/f4gb6n/i_made_...
how about you just don't do that like 99% of modern C++ projects and just accept "whatever the C++ compiler accepts".
Remember that "whatever the C compiler accepts" covers most of IOCCC too.
- Chrome: https://chromium-cpp.appspot.com/ - Mozilla: https://developer.mozilla.org/en-US/docs/Mozilla/Using_CXX_i...
This is really not my experience. Any decent-sized program will have parts more in a functional style, others in a more OOP one, others in regular-typed Stepanov bliss, others in template or constexpr metaprograms.... and this causes zero issues in practice once people get past their assumptions about what clean code should look like.
(+) offer not valid on microcontrollers or proprietary C++ compilers
(Callbacks from the garbage collector on deallocation are even worse. That way lies locking problems and "re-animation", a nightmare in Managed C++. One of the cleaner solutions to scope-based cleanup is the "with" clause in Python, which is based on "with" constructs in Common LISP. Only thing I've seen where exceptions in a destructor work right.)
C with improvements suffers from uncanny valley. If it's not plain C, then it's weird and non-standard, and C programmers don't want it.
So if you're deviating from pure boring C, then you can just as well switch to another language, and one that doesn't have legacy baggage.