Swiftfall
Swiftfall copied to clipboard
Card type could be a class rather than a struct
Cards are entirely immutable as is, and with like 13,000+ of them potentially in use, it doesn't really make sense to copy them around as much as they're currently forced to be. Consider making Card
a class.
I dont think it should be a class. Swift best practice is to keep data as structs as long as you dont have a reason to use a reference type (like when you want to be able to modify a existing piece of data). And also, value types aren't always copied. The standard library tries to use copy-on-write for value types when able to, so chances are there are not actually any copies made if you just pass them around, specially for immutable data.
I dont think we should use classes unless we can see some weird performance issues related to using value types.
Totally agree