3 ms·
> such protection is not always required Safety should be the default, with a way to opt out for people who have thought really hard about the consequences. If
by erik_seaberg 7y ago
> such protection is not always required
Safety should be the default, with a way to opt out for people who have thought really hard about the consequences. If I have to opt into the safe version, I need tooling to complain about everywhere I didn't do so.
- mytailorisrich 7y agoA pointer is neither safe nor unsafe and in my view people should be expected to know what they are doing when passing pointers across concurrent threads of execution. It's not rocket science. Goroutines are supposed to be lightweight so it makes sense to allow lightweight communication.
- qtplatypus 7y agoOn the other hand how often have you read in documentation “Do not mutate this buffer” or the equivalent? It is very possible to create traps for people who pick up your code later on. Having the compiler detect those problems rather then it causing a runtime error is something highly desirable.