Exactly! If you want to make your life as easy as possible, you'll have as high a percentage of pure functions as possible. This requires explicit effort.
While you can achieve purity in any language, functional programming languages let you achieve it far more easily.
Personally most side-effecting code I write is also externally facing code, which makes them Integration Tests rather than Unit tests.
I very rarely use spies/mocks and the like. Brittle.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great question!
Exactly! If you want to make your life as easy as possible, you'll have as high a percentage of pure functions as possible. This requires explicit effort.
While you can achieve purity in any language, functional programming languages let you achieve it far more easily.
Personally most side-effecting code I write is also externally facing code, which makes them Integration Tests rather than Unit tests.
I very rarely use spies/mocks and the like. Brittle.