-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Golden Rule of Generics #9
Comments
Comment by Viacheslav Dobromyslov (viacheslavdobromyslov) on 2020-08-13 06:12: Thank you for these examples. I want to add just one small note: |
Comment by danvdk on 2020-08-14 10:38: Are you referring to the |
Comment by Zackery Zing (zackeryzing) on 2020-08-14 02:59: In my linting rules, I always force functions to have a return type. I think in an article like this it is useful to have return types on all functions so there is no missing information. |
Comment by danvdk on 2020-08-14 07:35: What I’d really like is to have mouseover in the code snippets on the blog to see the inferred type, just like in your editor. I know some people (and some linters) insist on annotating all return types, but I do not. |
Comment by Romain Deneau (romain_deneau) on 2020-08-18 04:22: Useful rule, nicely explained in this article 👍 I suggest to rename it "The Golden Rule of Generic Functions", because it's about functions, not all generic types - see basic counter example: in this generic type, |
Comment by Vincent Jaubert (vincentjaubert) on 2021-05-16 05:14: This is indeed pure gold, thank you. |
Comment by ThomasBurleson on 2021-12-07 11:32: I really enjoyed reading this. Very important heuristics. |
The Golden Rule of Generics
https://effectivetypescript.com/2020/08/12/generics-golden-rule/
The text was updated successfully, but these errors were encountered: