roam/20210310182256-side_effects.org
2021-07-29 18:51:25 -04:00

16 lines
887 B
Org Mode

:PROPERTIES:
:ID: 0e092b64-dcaf-4579-9de8-0da3ede9dc53
:END:
#+title: Side Effects
In [[id:9e68d422-cced-4177-96d1-90f777b9a493][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 [[id:ec68f43a-7c63-4e22-81f9-b119791a6dd1][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.