diff --git a/GoForCPPProgrammers.md b/GoForCPPProgrammers.md index 60081fd9..a39e4c21 100644 --- a/GoForCPPProgrammers.md +++ b/GoForCPPProgrammers.md @@ -21,7 +21,7 @@ class methods, a class inheritance hierarchy, and virtual functions, Go
provides interfaces, which are discussed in more detail below.
Interfaces are also used where C++ uses templates. -
  • 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.
  • +
  • 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, non-smart "raw" pointers. Go's run-time system handles all of that error-prone code on the programmer's behalf.
  • Go has pointers but not pointer arithmetic. Go pointers therefore more closely resemble C++ references. One cannot use a Go pointer variable to walk through the bytes of a string. Slices, discussed further below, satisfy most of the need for pointer arithmetic.