# Should we avoid assignment of derived types in robust programs?

**URL:** <https://fortran-lang.discourse.group/t/should-we-avoid-assignment-of-derived-types-in-robust-programs/2359>\
**Category:** Uncategorized\
**Created:** [December 2, 2021, 8:59am UTC](https://fortran-lang.discourse.group/t/should-we-avoid-assignment-of-derived-types-in-robust-programs/2359 "2021-12-02T08:59:37Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![aradi](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/aradi/32/3659_2.png) [@aradi](https://fortran-lang.discourse.group/u/aradi)\
**Post date:** [December 6, 2021, 3:57pm UTC](https://fortran-lang.discourse.group/t/should-we-avoid-assignment-of-derived-types-in-robust-programs/2359/10 "2021-12-06T15:57:27Z")

</div>

As for the comment of @rouson : I absolutely agree, one should use allocatables, wherever it is feasible. Unfortunately, if you want to create an efficient list, allocatables are sometimes not enough. Think about a list containing large objects (arrays, other containers, etc.). You may wish the list to be able to deliver a pointer to a given list element, so that you can process the elements content without having to make a copy of it. As discussed in [Enforcing target attribute for actual argument in TBP calls](https://fortran-lang.discourse.group/t/enforcing-target-attribute-for-actual-argument-in-tbp-calls/2302), it is basically impossible to obtain a reliable pointer to the component of a derived type, if it has no pointer components…

---

_[View the full topic](https://fortran-lang.discourse.group/t/should-we-avoid-assignment-of-derived-types-in-robust-programs/2359)._
