IMMUTABILITY: PERKS AND QUIRKS – Jon-Tait Beason
Writing Swift, I have a strong preference for immutable objects. Why? Because immutability leads to simplicity and clarity since implicit in an object’s creation, is a guarantee that it will never change. It is remarkable how much this single, seemingly, simple fact, can make programs easier to verify, and reason about. However, in object-oriented environments, blindly defaulting to immutable objects can lead to unintended consequences.
In this talk, users will see the potential downfalls of using mutable objects and how immutability can make your programs safer and easier to reason about. I will also do a walk through of how I chose an immutable object to solve a problem, how that lead to a perplexing bug, and how I resolved it. Finally we will discuss what to consider when choosing between immutable and mutable objects.
About Jon-Tait Beason:
Jon-Tait Beason (Jazbo) is a iOS software engineer at Glowforge, maker of the 3D Laser Printer. He has a background in education and enjoys teaching and learning. To that end, he spends a lot of time hanging out in iOS communities where he learns from others and helps engineers starting out.