That talk's principles apply to any language, though (e.g. React in JS):
Play "the value game"; separate inert and behaving layers.
Conversation
Good talk, but how should the value layer archive itself? Or is that an object layer function?
1
Serialization is a value layer responsibility (e.g. MyValue -> NSData); file I/O is not.
1
You’re unable to view this Tweet because this account owner limits who can view their Tweets. Learn more
You’re unable to view this Tweet because this account owner limits who can view their Tweets. Learn more
Didn't mean to imply that choice was important.
protocol FooEncoder {
func encode() -> Foo
}
Foo ⊂ [XML, JSON…]
1
1
1
. If my data is a graph or tree, I can save easily as objects or even C structs. But Swift structs?
1
Replying to
Replying to
thinking about it, a value type for a tree node doesn’t seem viable. Never mind the serialisation issue.
A leaf perhaps?
1
It's certainly viable (React does); you just have to reify identity (i.e. give nodes a key)

