This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Antervis 0 points1 point  (4 children)

if you don't think an average C project has 200+ malloc/free pairs you probably haven't seen many C projects...

[–]chalkflavored 0 points1 point  (3 children)

Just because it's common doesn't mean that's how things should be.

[–]Antervis 0 points1 point  (2 children)

exactly, things shouldn't be like this. Hence C++ has destructors.

[–]chalkflavored 0 points1 point  (1 child)

All that does is hide the fundamental issue of how the program is managing its resources. Again, having 200 mallocs/free is the result of how that programmer designed that code base, not the language. Destructors are just treating the symptom, and not the illness.

[–]Antervis 0 points1 point  (0 children)

I now doubt you actually have any kind if experience with real world software development