I wrote an article for this month's on how to use value types to improve your code's flexibility + clarity.
objc.io/issue-16/swift
Conversation
Replying to
FWIW function values are also reference types (observable via captures).
1
Word, thank you. I'll see if I can slip in a note about how putting closures in a value type can create dependencies.
1
Show replies
Replying to
More powerful value types (and generics) are the most exciting Swift features to me coming from a C++ background.
Replying to
. So clear! “If you’re accessing a reference to a mutable instance, you have an implicit dependency on all its other owners“
1
Replying to
Cheers, great read. Classes for side effects, Struct values for purity - really interesting idea.
1
Replying to
It would be interesting to hear your thoughts on when to declare top level functions and when to declare methods on structs?
2
Perhaps another article?!







