logoalt Hacker News

mejutocoyesterday at 2:26 PM1 replyview on HN

> how can I take the 90% or 95% of this function that is pure and pull it out, and separate the impure portion (side effects and/or stateful) that now has almost no logic or complexity left in it

They addressed this concern already. These are not contradicting approaches.


Replies

SAI_Peregrinusyesterday at 5:03 PM

I think the disconnect is that the impure portion often has substantial amounts of inherent complexity. If you're working at a high level that's handled by a lower level (OS, framework, etc.) but somebody is writing that framework or OS or HAL. And they need to test too, and ultimately someone is going to have to make a test double of the hardware interface unless all testing is going to require hardware-in-the-loop.