John Siracusa on Nostr: Why in the world does this interface look like this: .padding(.top, 1) ...
Why in the world does this interface look like this:
.padding(.top, 1)
.padding(.leading, 2)
.padding(.bottom, 3)
.padding(.trailing, 4)
…or this:
.padding(EdgeInsets(top: 1, leading: 2, bottom: 3, trailing: 4))
…instead of the much more idiomatic:
.padding(top: 1, leading: 2, bottom: 3, trailing: 4)
Like, who in the world thought of this foo(.key, value) API interface in a language with named parameters?!
#SwiftUWhy
.padding(.top, 1)
.padding(.leading, 2)
.padding(.bottom, 3)
.padding(.trailing, 4)
…or this:
.padding(EdgeInsets(top: 1, leading: 2, bottom: 3, trailing: 4))
…instead of the much more idiomatic:
.padding(top: 1, leading: 2, bottom: 3, trailing: 4)
Like, who in the world thought of this foo(.key, value) API interface in a language with named parameters?!
#SwiftUWhy