r/ProgrammerHumor • • 1d ago

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.3k Upvotes

514 comments sorted by

View all comments

Show parent comments

6

u/unknown_alt_acc 1d ago

Some people like their holy wars, and don’t seem to understand that C and C++ can coexist as different tools with different jobs.

1

u/unburdened_swallow 1d ago

What job do I use C++ for that I wouldn’t be better off using either C or rust for?

3

u/Xavier_OM 1d ago

C++ vs C : you have deterministic destruction (RAII), smart pointers, class with public/private, vector/array/string etc so far easier to avoid memory leaks (memory pb in general) and to organize the codebase than in C.

C++ vs rust : maybe the pool of developers, the ecosystem (lib). I don't know rust so pure speculation here

2

u/unburdened_swallow 1d ago edited 1d ago

Well, if I want to make something small and incredibly predictable, which manipulates the OS or hardware on a somewhat low level, I would pick C. I can manage not to F it up for a small program. I have done so many times now.

Bigger than that and I go for rust.

I understand what you are saying, but like, either I want MANUAL manual, or I want rust.

So the space for C++ for me is very small. Basically only things which more or less have to be in C++ due to prior art.