# Do colored subprograms exist in Ada?

**URL:** <https://forum.ada-lang.io/t/do-colored-subprograms-exist-in-ada/343>\
**Category:** General\
**Created:** [February 24, 2023, 5:08pm UTC](https://forum.ada-lang.io/t/do-colored-subprograms-exist-in-ada/343 "2023-02-24T17:08:11Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![zetah11](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/z/58f4c7/32.png) [@zetah11](https://forum.ada-lang.io/u/zetah11)\
**Post date:** [March 7, 2023, 6:06pm UTC](https://forum.ada-lang.io/t/do-colored-subprograms-exist-in-ada/343/6 "2023-03-07T18:06:58Z")

</div>

That’s fair. Spawning tasks inside subprograms is something that should be done with a bit of care since the overhead can sometimes offset any gains, and the use of entries can easily create hard-to-debug deadlocks. Still, there are some situations where I’ve found it to be a useful tool, such as reading multiple large files at once. That’s a situation where you’d typically reach for `async`/`await` in another language, hitting the function coloring problem. Having tasks inside subprograms let’s you neatly encapsulate that.

That said, I’m not a terribly experienced Ada programmer, so it’s quite possible it is an anti-pattern.

---

_[View the full topic](https://forum.ada-lang.io/t/do-colored-subprograms-exist-in-ada/343)._
