# Changes to the struct update syntax

**URL:** <https://forum.elixirforum.com/t/changes-to-the-struct-update-syntax/71232>\
**Category:** Elixir Notices\
**Tags:** official-elixir-notice\
**Created:** [June 11, 2025, 3:45pm UTC](https://forum.elixirforum.com/t/changes-to-the-struct-update-syntax/71232 "2025-06-11T15:45:44Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Eiji](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/eiji/32/36743_2.png) [@Eiji](https://forum.elixirforum.com/u/Eiji)\
**Post date:** [June 11, 2025, 4:25pm UTC](https://forum.elixirforum.com/t/changes-to-the-struct-update-syntax/71232/4 "2025-06-11T16:25:20Z")

</div>

> [@josevalim](#):
>
> The argument to deprecate the struct update syntax is to reduce the language surface.

Reasonable, but **standalone** not enough from DX experience. :icon_confused:

> [@josevalim](#):
>
> While I believe the above is an improvement to Elixir v1.19.0-rc.0, as it forces people to pattern match before we potentially deprecate struct updates, we still need to decide if we want to deprecate the struct update syntax in v1.20 or later.

By **default** I prefer a **flexibility** in the code. However if there is a **real value** for a developer in exchange (as you have described) then it’s not just an another proposal, but a new good practice that’s better to be followed. 💪

> [@josevalim](#):
>
> The main argument is that, if you have a long function, `%User{user | ...}` is a reminder and a type assertion of the type of the struct, while `%{user | ...}` would require you to keep more context in your head.

Let’s see it by example … I may not agree with some `credo` checks and they can even give sometimes a false-positives, but after some time I’ve realised that my code have much better quality. In theory I have forced myself to change a style, but in practice I’m more proud of my code than before and I believe that the best argument that could be raised. ✋

So **YES** , please deprecate it! 👍

**Edit** : Would there be any problem to ask for a patch release for `db_connection` and `postgrex`? I saw that you did that for `ecto` already:

> ## v3.12.6 (2025-06-11)
> 
> Fix deprecations on Elixir v1.19.

---

_[View the full topic](https://forum.elixirforum.com/t/changes-to-the-struct-update-syntax/71232)._
