Comment

Comment by kevingadd

A pointer to T is not the same as Nullable<T>. There are many important differences.

The expressible values for a Nullable<T> are, in theory, the following:

A valid instance of T, or Null

The expressible values for a pointer-to-T are, in theory, the following:

A null pointer (pointer-to-0)

A pointer to a valid instance of T

A pointer to a previously valid, but now invalid because it was freed, instance of T

A pointer to an arbitrary location in memory

In systems programming (the space Go is presumably designed to be most useful for), the distinction between valid and invalid data is pretty important, so it's a little lazy to say 'just use pointers' when there are examples out there of safer, more efficient alternatives.

parent kevingadd 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton