It works fine when your function takes a single primary argument—like `getLastWord(word: string, options?: TGetLastWordOptions): string | undefined`. The function name makes the purpose clear, and with just one main argument, it’s easy to follow. Sure, you're still "guessing" what the first parameter is but it’s not a heavy mental lift. You could argue that as long as you're consistent, using positional arguments in binary functions is fine–the pattern is clear and predictable.
But in the example from the OP, there isn’t really a primary argument. You're dealing with multiple values that carry equal weight, which makes positional arguments harder to reason about at a glance.
carlos-menezes|10 months ago
But in the example from the OP, there isn’t really a primary argument. You're dealing with multiple values that carry equal weight, which makes positional arguments harder to reason about at a glance.