wordfor

side effect

noun

Software design

  1. Anything a function does besides returning a value, such as writing to a database, changing a variable or sending a request. getUser() had a side effect: it updated the last-seen timestamp, so the tests that called it twice disagreed.

In plain words

  • the function changes things it shouldn't
  • calling it twice does something different
  • a getter that also writes to the database
  • hidden changes when I call a function

See also pure function idempotency

Find similar words