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.

Why side effects matter here

When an AI agent refactors a function, it reasons about the function's inputs, outputs, and logic. The side effects in the middle are not part of that reasoning. They can be moved, dropped, or modified without breaking the function's contract. So they often are.