3 ms·
> Why is it so difficult to reason about whether or not code will have side effects? I’m not sure exactly what you mean here, but I can’t think of any reasonab
by tshaddox 5y ago
> Why is it so difficult to reason about whether or not code will have side effects?
I’m not sure exactly what you mean here, but I can’t think of any reasonable way to write a JavaScript framework that invokes developers’ JS code containing functions, closures, etc. and makes it simple to reason about whether that code will have side effects. This seems like a basic consequence of Rice’s theorem. I suppose you could have a compiler that only supports a strict subset of JavaScript and makes side effects easier to reason about, but arguably that would just be its own separate language altogether.