2 ms·
This actually is what drew me to functional programming in the first place. I'd recently been on a unit testing kick, and figured that if you get rid of mutabl
by nostrademons 18y ago
This actually is what drew me to functional programming in the first place. I'd recently been on a unit testing kick, and figured that if you get rid of mutable state and have function outputs depend only upon inputs, your code suddenly becomes much easier to unit test.
- deleted 18y ago[deleted]
- nostrademons 18y agoProbably, yes. They get a bit less useful, but they also get a bit easier to write. And the point of unit tests isn't really to smoke out every possible problem: it's to give you confidence in your code, so you can say "This will work" instead of "This should work". Functional programs still need some sort of test suite to achieve this confidence.