What Are Side Effects Of A Function

[!INFO]-
topic: ๐Ÿงน Clean Code
links: Keeping your functions pure
source: Clean Code | Udemy
tags: #permanent-noteย #published

Last Modified: =dateformat(this.file.mtime, "MMM. dd, yyyy - HH:mm")


A side effect happens, when a function changes something in the state of your application. This could be writing to a database, connecting to an API, setting a variable outside the function's scope etc.

Side effects are not bad per se, they are needed in your code. But unexpected side effects are. So, you should aim to name your functions in a way, that the side effect is to be expected.