Software Design/Begin the name of a function with side effects with a verb
Checklist questions:
- Names of functions with side effects begin with a verb, rather than just being a noun phrase?
Why edit
- Thrutfulness
- Easier to reason about the composition of side effects in implementations of functions in programming environments that don't allow expressing side effects on the type level => less cognitive load and more robustness.
Why not edit
Beginning the name of a function with side effects with a verb doesn't provide much distinction in environments which support expressing side effects on the type level and where there are plenty of side-effect-free functions with names starting with verbs already. In such environments functions with side effects may have a dedicated prefix, for example, unsafe-
in Cats Effect library for Scala.[1]