Re:Talking to C Programmers about C++ [video]
by Koshkin on Sunday September 25, 2016 @10:38AM
(#12575511)
Problem is, using destructors (and RAII) may have, in general, certain performance implications that C may not be willing to deal with. This is somewhat similar to demanding that C had a garbage collector built in. Note that, being lazy, memory management by means of garbage collection may turn out being more efficient than using the (eager) destructors.
[ Parent
| on HN ]
Re:Talking to C Programmers about C++ [video]
by hackits on Sunday September 25, 2016 @10:51AM
(#12575572)
Don't see how there could be any performance implications with having RAII within C. It would be a simple method call with the this pointer to the struct during complication. Though if your performance consideration is at the assembly code level why use C?
I've had some good/bad experiences with garbage collectors. They do help improve productivity and ROI within the enterprise space where memory isn't too much of of issue. Then when memory does become a issue within smaller memory footprint environments they can be a real pain in the ass.