3 ms·
> Have you been able to reduce the `side-effects` significantly or have just become more aware of it? Yes, sorry, I think I didn't explain myself very well. P
by DonaldPShimoda 8y ago
> Have you been able to reduce the `side-effects` significantly or have just become more aware of it?
Yes, sorry, I think I didn't explain myself very well.
Prior to learning Haskell and embracing The Way, my code was fairly covered in side-effects. I was a relatively junior programmer at this point (many years of experience because I started young, but few years of real education). Side-effects were just, you know, a thing that happened because they were "the easy way".
After learning Haskell, I became much more conscious of side-effects. I realized that a lot of things I used to do could be done without side-effects, mostly by writing better functions and thinking more deliberately about how to eschew the side-effects.
That said, it's not like they're gone. It's just that I'm much more careful about them. I "avoid" them in that I do my best not to include them, but if there's a genuine use for them then that's fine. However, I have taken to naming my functions better to reflect their side-effecting nature, and I try to move the side-effecting functions to places that make more logical sense (instead of just wherever).