3 ms·
> If it exits, who cares if the memory of the process is corrupted? People care when memory is corrupted without the process exiting. It is usually better for
by parenthephobia 9y ago
> If it exits, who cares if the memory of the process is corrupted?
People care when memory is corrupted without the process exiting. It is usually better for a program to crash than for it to continue having corrupted its data. The former gives you x-ray machines which sometimes won't start, whilst the latter gives you x-ray machines which sometimes give the patient cancer.
I say better, not best. Best, obviously, is for as many failure modes as possible to be detected before the code is deployed. Particularly if you're programming a machine that can kill people. But in the comparison between Go's interface{} and C's void*, neither language has that option.
- hota_mazi 9y ago> It is usually better for a program to crash than for it to continue having corrupted its data And it's even better to no let this program get corrupted data in the first place, which languages with a weak type system (such as Go) allow to happen whenever you use `interface{}`.