|
|
|
|
|
by arinlen
1401 days ago
|
|
> Yes, and a great way to do that is to read documentation, of which Typescript is frequently lacking. I completely disagree, and I was surprised by this sort of comment. Find me a single programming language whose docs are as good as TypeScript's docs and reference. I'd be surprised if you could come up with a single example. |
|
There are lots of ways to do things that you kind of just have to learn from reading blog posts, or reading code and then asking in the discord when you see something undocumented (because have you tried googling "what does <T=...> in Typescript mean"?).
Ideally, at the very least, all syntactic features and keywords of the language should be documented, but it's more than that; Typescript is a metalanguage, and authors of many libraries have also developed patterns which are essential for describing complex types. Some of these patterns are documented (for example, discriminating union), and some are not (for example, opaque types). And some features which are documented could do with a lot more exposition and functional examples ("as const"), or notes on when to avoid (enum).