|
|
|
|
|
by aleksiy123
51 days ago
|
|
I pretty much always prefer using an options struct as soon as there is more than one optional argument. Comes out cleaner because overriding a default argument doesn’t force you to also do all the positional arguments in front of it. Designated initializers make it look really nice imo. I feel like the brackets are no big deal. Python has sort of the opposite when you need to use *kwargs. |
|
C makes it much better than C++ in that the designated initializes can be set in any order --- so I don't need to remember the often-arbitrary order of struct fields for the options struct.
I find it weird that C++ took this great C feature and kneecapped it ...