3 ms·
That's one reason I really like functional programming: it's easier to test pure functions, vs code with side effects that requires you to look at the internal
by macintux 8y ago
That's one reason I really like functional programming: it's easier to test pure functions, vs code with side effects that requires you to look at the internal state afterwards.
- tobr 8y agoOn the other hand, pure functions are also much easier to reason about, thus much less likely to cause bugs from "a tiny change" in the first place. It's in the messy imperative stuff things tend to break in incomprehensible ways, and where you really need tests.