Skip to content
Resources / Glossary

Side effect

Code that affects something outside the function it lives in. Analytics calls are side effects. So are logs, emails, and metric increments.

Coding agents

About this term

This page is part of the Skene analytics instrumentation glossary. Use it as a reference when writing specs, dashboards, or playbooks.

Canonical glossary index: /resources/glossary

Definition

In programming, a side effect is any code that changes state outside its local scope. Writing to a database is a side effect. So is calling an external API, and so is emitting an analytics event.

In analytics work, every tracking call is a side effect: the function does the same job whether the event fires or not. A common mistake is to read a passing test run as proof that a change kept its tracking, but a test of return values never sees the event. A Conditional firing change is the harder case, where the event still exists but fires under different conditions. The Analytics call entry covers the call itself, and Coding agent covers why rewrites put it at risk.

Why side effects matter here

A refactor can preserve a return value while changing a side effect. Review tracking calls, external writes and their conditions explicitly; passing functional tests alone does not establish that the same evidence is still collected.