Top "Side-effects" questions

A side-effect is a programming term that refers to intended changes in the program behavior, such as a variable changing value.

Why are global variables evil?

I'm trying to find out why the use of global is considered to be bad practice in python (and in …

python global-variables side-effects
Javascript closures and side effects in plain English? (separately)

I've been reading some JavaScript books and I always hear about closures and side effects. For some reason I can't …

javascript closures side-effects
What Does Webpack 4 Expect From A Package With sideEffects: false

Webpack 4 has added a new feature: it now supports a sideEffects flag in the package.json of the modules it …

javascript webpack bundler package.json side-effects
if statement - short circuit evaluation vs readability

Sometimes, an if statement can be rather complicated or long, so for the sake of readability it is better to …

c++ if-statement short-circuiting side-effects
Why are assignments not allowed in Python's `lambda` expressions?

This is not a duplicate of Assignment inside lambda expression in Python, i.e., I'm not asking how to trick …

python lambda python-internals side-effects
Scala: "map" vs "foreach" - is there any reason to use "foreach" in practice?

In Scala collections, if one wants to iterate over a collection (without returning results, i.e. doing a side effect …

scala foreach scala-collections side-effects
Mock side effect only X number of times

I have a celery retry task that I would like to test that it retries until successful. Using mock's side_…

python unit-testing mocking side-effects
Why is the raising of an exception a side effect?

According to the wikipedia entry for side effect, raising an exception constitutes a side effect. Consider this simple python function: …

functional-programming side-effects
Infinite loop with ngrx/effects

I'm trying to understand ngrx/effects. I have built a simple function that increments number by 1 with each click. But …

angular redux side-effects ngrx
Are side effects a good thing?

I feel the term rather pejorative. Hence, I am flabbergasted by the two sentences in Wikipedia: Imperative programming is known …

functional-programming procedural-programming side-effects