HACKER Q&A
📣 iamwil

How have side-effects complicated your code base?


I recently read "Out of the Tarpit", where the claim was that state management and side-effects was a big cause of complexity in our code bases. Wanted to hear concrete stories of whether that was true.

A friend was telling me that he had to write a user onboarding flow involving external APIs like Stripe and Mailchimp. Writing it and testing it involved setup on staging accounts and mocking the objects that got returned from the service.

I was wondering if HN had any war stories about how side-effects really made your code base more complicated and made your job harder. Or maybe it wasn't, and you were able to find easy ways to mitigate state management/side effect complications?


  👤 PaulHoule Accepted Answer ✓
Not as much as the lack of side effects complicates your code when you're struggling with concepts like "A Monad is Like A Burrito".

The whole point of a lot of code is to have side effects.