UserDefaults1 use-case is preserving User Interface states, one of the essential items on the list of every good Mac and iOS application.
UserDefaults is one of the most powerful examples of why I love writing programs for Apple hardware. It is easy to get started, performant, and got even simpler2 over time. Just two three lines of code and you wrote something to permanent storage. Which you can read at any time, so efficient, adding your caching code would even hurt performance3.
Having an alternate code path for “no value set” is also generally unnecessary, as you can provide a default value instead.
Thank you, David, for this excellent guide.