3 ms·
Weird that you started using a functional approach, noticed that it’s easier to unit test, and drew the conclusion that unit testing is what led to more readabl
by zarathustreal 6y ago
Weird that you started using a functional approach, noticed that it’s easier to unit test, and drew the conclusion that unit testing is what led to more readable code. Consider that functional code is the source of readability. Also we don’t typically call it “dependency injection” in the functional world
- goodoldneon 6y agoYou're absolutely right: functional code is the source of the readability. But writing unit tests incentivizes engineers to keep things functional. What's a better term than "dependency injection"? What should I call an argument whose default is always used in production code, but is there to make passing a mock easy? I'm not trying to be snide -- I'm genuinely curious.
- cnity 6y agoOT: Good Old Neon is a fantastic piece of writing.
- bigmanwalter 6y agoI always just called it a "default argument"