# Why avoid mocks

**URL:** <https://forum.elixirforum.com/t/why-avoid-mocks/1396>\
**Category:** Questions\
**Tags:** mocks\
**Created:** [August 18, 2016, 7:59pm UTC](https://forum.elixirforum.com/t/why-avoid-mocks/1396 "2016-08-18T19:59:48Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![josevalim](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/32/1787_2.png) [@josevalim](https://forum.elixirforum.com/u/josevalim)\
**Post date:** [August 20, 2016, 6:37pm UTC](https://forum.elixirforum.com/t/why-avoid-mocks/1396/10 "2016-08-20T18:37:26Z")

</div>

> [@michalmuskala](#):
>
> Having said that, passing the dependency through application environment is indeed a side-effect and may be not considered a good style, but it’s very simple and convenient.

I partially agree. If the value never changes, it will be side-effect free. That’s exactly what happens when the application environment is read at compile-time rather than runtime. The behaviour at runtime is guaranteed to be the same.

---

_[View the full topic](https://forum.elixirforum.com/t/why-avoid-mocks/1396)._
