3 ms·
> C's "everything is a memory leak" any better? That's a bit hyperbolic, unless you apply the same phrase to any language (including C++) without a full tracin
by notacoward 4y ago
> C's "everything is a memory leak" any better?
That's a bit hyperbolic, unless you apply the same phrase to any language (including C++) without a full tracing garbage collector or equivalent. X leaking a resource is not the same as X returning a resource that the caller is explicitly responsible for freeing. Further, C in practice is not as bad as you portray. Maintainers of large open-source projects, of which I used to be one, often define their own memory-management facilities and rules which are just as good as C++'s in preventing leaks for most code. I think they shouldn't need to nowadays, and that C would be a poor choice for a new project at any level, but that's easily shown without resorting to hyperbole.