6 ms·
> Go provides automatic garbage collection of allocated memory. It is not necessary (or possible) to release memory explicitly. There is no need to worry about
by blt 12y ago
> Go provides automatic garbage collection of allocated memory. It is not necessary (or possible) to release memory explicitly. There is no need to worry about heap-allocated vs. stack-allocated storage, new vs. malloc, or delete vs. delete[] vs. free. There is no need to separately manage std::unique_ptr, std::shared_ptr, std::weak_ptr, std::auto_ptr, and ordinary, "dumb" pointers. Go's run-time system handles all of that error-prone code on the programmer's behalf.
This is not an attractive statement to C++ programmers like the author probably imagines it is. We like being in control of our memory. C++ programmers who would prefer to not manage memory have probably already switched to Java or C#.
- deleted 12y ago[deleted]
- enneff 12y agoIan Lance Taylor wrote the article; he's one of the best C++ programmers I know. So I imagine he is speaking to _some_ subset of C++ programmers, just maybe not the one you belong to.