3 ms·
Maybe put another way: Some algorithms are more simply represented using an imperative aproche than a functional, and sometimes the benefits of easily understa
by astine 17y ago
Maybe put another way: Some algorithms are more simply represented using an imperative aproche than a functional, and sometimes the benefits of easily understandible code outway the benefits of having no side effects.
- jrockway 17y agoIs effectful code ever easy to understand? (The answer is yes, because it often follows expectations. This is why dynamically-typed languages work. Although there is no explicit structure, you can generally see what type the author wants something to be by understanding what the code is trying to do. With imperative programming, the same is true. The "+" function probably doesn't depend on your fooBarBaz global variable, so you can pretend it doesn't. But there is no guarantee -- and programming based on guarantees is safer than programming based on hoping the author is doing what you think he's doing.)