3 ms·
> No guessing. No worrying about the order. Your code is self-documenting. Plus, TypeScript gives you full autocompletion and type safety. 1. Most of the time,
by 9d 1y ago
> No guessing. No worrying about the order. Your code is self-documenting. Plus, TypeScript gives you full autocompletion and type safety.
1. Most of the time, arguments are not the same type, so if you're using TypeScript, you're already getting errors at this point. In your example, only first/last names might get mixed up. And if you still get those wrong while writing that code, you're just phoning it in atp and maybe should take a day off.
2. The same TypeScript that checks your types, also lets you see the signature when hovering over the function.
In real world coding, this isn't an issue, and you'll probably give up keeping this "rule" after a year or two. But good that you're at least thinking about these kinds of things.
- carlos-menezes 1y agoIt’s a preference grounded in long-term ergonomics that work well for me. I’ve been using this "rule" for over two years now and haven’t found a reason to give it up.