Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
SebastianKra
3 months ago
|
parent
|
context
|
favorite
| on:
Getter-Setter Pattern Considered Harmful
JS/TS has
y = { ...x, change: 'b' }
And Swift avoids the mutability-problem all together, by providing structs with copy-on-write and self-mutating methods:
https://docs.swift.org/swift-book/documentation/the-swift-pr...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
https://docs.swift.org/swift-book/documentation/the-swift-pr...