3 ms·
A lot of these examples are smelly IMO. Your colleagues in marketing are not debugging your code base. You work with other developers who definitely know what I
by GS4B2t4we 8y ago
A lot of these examples are smelly IMO. Your colleagues in marketing are not debugging your code base. You work with other developers who definitely know what Ints and Strings are, so when you disguise these basic types in structs or type-aliases, you are basically doubling up the API you and your colleagues are working with.
- veidr 8y agoWell, you're not only making it easier for your colleagues in marketing to be able to make a code change (hey, it happens more than you might think!) but you're also making it easier for your future self to come back to the code base without having to remember as much. Most important, though, you are structuring the code in a way that provides better actionable understanding of the intent not only to the humans that work on it, but also your intrepid robot buddies, the Swift compiler / static analyzer. Who happen to be extremely helpful allies in this particular language. In Swift, I would recommend using dedicated types like AccessToken and RefreshToken, instead of plain strings, 100% of the time.