3 ms·
I used this pattern more often than not before typescript but now it is harder to argue that point in typescript, although I do prefer it still. Swift is readab
by sebringj 5y ago
I used this pattern more often than not before typescript but now it is harder to argue that point in typescript, although I do prefer it still. Swift is readable in that it has named parameters that can be in any order similar to a javascript object but even more compact.
- RussianCow 5y agoTypeScript doesn’t help disambiguate a poorly named boolean parameter though; it only helps when the expected value is a specific object type, and even then may be ambiguous.
- sebringj 5y agotrue but isn't that the case in typed languages?
- RussianCow 5y agoIt's the case in all languages, but I was specifically responding to this: > now it is harder to argue that point in typescript IMO, TypeScript does nothing to change the necessity of the object parameter pattern.