# Nested Updates

**URL:** <https://forum.elixirforum.com/t/nested-updates/12966>\
**Category:** Questions\
**Created:** [March 8, 2018, 1:01pm UTC](https://forum.elixirforum.com/t/nested-updates/12966 "2018-03-08T13:01:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![peerreynders](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/32/5826_2.png) [@peerreynders](https://forum.elixirforum.com/u/peerreynders)\
**Post date:** [March 8, 2018, 1:39pm UTC](https://forum.elixirforum.com/t/nested-updates/12966/3 "2018-03-08T13:39:37Z")

</div>

> [@mmport80](#):
>
> I see the problem, we are creating new records each time : )

I think you may be seeing the remnants of a statement based mindset. Because from the script it isn’t clear whether you actually wanted _different_ records or whether you are simply advancing the state of the same conceptual record - for which Elixir does allow rebinding.

The script still has that imperative “do this, then do that” kind of feel (which is typical for scripts anyway but I assume that the original code looked like that as well).

I personally have no qualms having lots of well-named single line functions that also use argument pattern matching for destructuring; essentially allowing for “composed functions” (not necessarily in the FP sense and not always with the pipeline operator) so that _if possible_ the code can look more like a progressive _flow_ of value transformations rather than some step by step recipe.

---

_[View the full topic](https://forum.elixirforum.com/t/nested-updates/12966)._
