5 ms·
I think stuff like this really comes down to getting used to and accepting. I had the same views on code prettiers. I thought, aligning your code by hand makes
by adminu 4y ago
I think stuff like this really comes down to getting used to and accepting.
I had the same views on code prettiers. I thought, aligning your code by hand makes you think about the structure. That you'd invest more time in making your code readable and thus it would be more readable.
When I first got to use prettier on a team and accepted it's value, the benefits I perceived were so vast, that my arguments seemed irrelevant in comparison.
- bestest 4y agoSure! I want prettier for types. So I don't have to manually type the obvious things. The IDEs are smart, but I haven't found one that would be that smart.
- debone 4y agoI'm wondering what do you mean by obvious things, do you have any example? TypeScript can infer types[0] even through context, and it's even a good practice to let TypeScript do that for you. [0]: https://www.typescriptlang.org/docs/handbook/type-inference.html https://www.typescriptlang.org/docs/handbook/type-inference....
- jdthedisciple 4y agobut wouldn't the static code analysis complain in that example? at least once you want to do anything meaningful with that x
- schwartzworld 4y agoIntelliJ / WebStorm has this exact feature. You can also generate API types based on your backend.
- bestest 4y agoThat is cool. Will try that. But the type information the IDE provides to me is sufficient even without TypeScript. So, back again to the question — is TypeScript worth it?
- schwartzworld 4y agoI had the same question initially. TypeScript is the way you configure intellisense. Some types can be inferred, but not all, and most of the typing I do is to _restrict_ what data can be used. TS gives you feedback anywhere you ask for it, and paired with IntelliJ I feel like I have superpowers. Another point: You can create types for your API client programatically, meaning your front-end can be aware of exactly what types your backend is returning. This cannot be accomplished with intellisense.