3 ms·
> pure functions always do exactly the same thing Unless there's a hardware error, OS error, language bug or any of the number of other circumstances which can
by klibertp 9y ago
> pure functions always do exactly the same thing
Unless there's a hardware error, OS error, language bug or any of the number of other circumstances which can messes up your assumptions. As Joe Armstrong said, you can't type-check being hit by a lightning, not to mention your pure function may never terminate simply because the thread it ran on was killed.
> Language error-proneness is directly proportional
Citation needed (and it doesn't matter to what exactly you think it's proportional at this point). A large-scale, confirmed independently a couple of times, academic study would do.
In other words: it's not that simple, even if you choose to ignore performance. Immutable data and pure functions are great and should be used wherever it makes sense, but they are not a silver bullet.
- AnimalMuppet 9y agoAgree. qwerty456127 speaks as if mutation is the only source of errors. It's not. (And timing is not the only other source of errors. And hardware failure is not the only remaining source of errors. There's lots of ways that things go wrong.)
- qwerty456127 9y agoMutation is not the only source of errors but I believe it is the source of at least 80% (probably more) of errors.