roam/20210310182256-side_effects...

887 B

Side Effects

In Software Development, the effects of running a function or bit of code outside of its local environment. Examples include reaching out over the network to talk to a database, reading or writing a file on disk, or printing some output. This contrasts with Purity, where such effects are not allowed.

Effectful code has implicit, rather than explicit, state. This is to say, the behavior of the code may differ not based solely on its explicit inputs, but also values at a higher level of scope, the stability of the network, or the current contents of a file. They may also impact external state, which can make them difficult to reason about and sensitive to the order in which statements are executed.