O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Threats

While the structure of value types encourages testability, isolation, and interchangeability, one can define value types that diminish these advantages. Value types containing code that executes without being called by its owner are generally hard to track and reason about, and should often be avoided.

Also, value types containing reference types are not necessarily isolated. Using reference types in value types should generally be avoided as they are dependent on all other owners of that referent. These kinds of value types are also not easily interchangeable as the external reference might interact with the rest of the system and cause some complications.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required