Remix.run Logo
locknitpicker 15 hours ago

I was wondering what is the community's opinion on the official TypeScript Handbook

https://www.typescriptlang.org/docs/handbook/intro.html

primitivesuave 13 hours ago | parent | next [-]

I love the Typescript handbook, but wanted the examples to be "runnable". It turns out that the TypeScript compiler runs pretty fast in the browser for trivial code snippets, so I threw together https://ts.coach (TypeScript handbook with code examples that execute in the browser + instant type checking)

epolanski 13 hours ago | parent [-]

This is neat, but has the same issue of all similar projects: mobile unfriendly editors for snippets editing.

primitivesuave 12 hours ago | parent [-]

Thank you for the excellent feedback. I had this realization a while back that I'm a mobile user during "consumption" (e.g. browsing HN late at night), but a desktop user for "production" - now I see how it applies to this side project as well. Also, I still need to figure out some React performance issues which make it virtually unusable on pre-2020 machines :(

This comment actually invigorated me to try the site from my phone and improve the experience, so I sincerely thank you for the motivation.

epolanski 10 hours ago | parent [-]

The typescript documentation has the same issue.

I've considered doing a similar project to yours writing or using some mobile friendly editor and hooking it directly into TypeScript's LSP, which can be easily added to a web page, but was never motivated/disciplined enough to push through it.

wk_end 14 hours ago | parent | prev | next [-]

Speaking only for myself, not for the community:

It should be your first resource when looking something up, it's usually quite clear and often helpful, but I find it somewhat confusingly organized and rather incomplete. It's more of a reference than a tutorial or guidebook, per se.

tresil 13 hours ago | parent | prev | next [-]

I show people coming from object oriented backgrounds this page first in order to correct the perception that TypeScript is best used with that programming paradigm.

https://www.typescriptlang.org/docs/handbook/typescript-in-5...

locknitpicker 12 hours ago | parent [-]

> I show people coming from object oriented backgrounds this page first in order to correct the perception that TypeScript is best used with that programming paradigm.

I think you're confusing things. Languages like Java or C# impose an artificial constraint that free functions don't exist and functions can only exist as members of a class. You don't see this constraint in OO languages such as C++.

Also, it's a simplistic assertions to claim that classes have no place in TypeScript or aren't idiomatic. That's just nonsense based on specious reasoning. Classes/objects with function members are still the best way to implement some features. I'm seeing too many people writing absurd typescript code who go through great lengths to avoid a class because they think a class is taboo. They pull out convoluted stunts like passing closures as object members, just to avoid the sin of rolling out a class.

tresil 11 hours ago | parent [-]

To clarify, I’m not claiming that classes have no place in Typescript. What I’m saying is that many people coming from OOP backgrounds tend to have the mistaken belief that TypeScript is best written with that paradigm. While it can be in some cases, it should not be assumed to be the best way. In fact, the documentation linked above asserts that “free functions over data” are extremely powerful, and “tend to be the preferred model for writing programs in JavaScript.”

throwthro0954 14 hours ago | parent | prev | next [-]

I prefer this over everything else I've seen so far, it actually is concise.

throw_await 13 hours ago | parent | prev [-]

Good, but it only gives a very brief overview, no explanations

epolanski 13 hours ago | parent [-]

I don't know, the number of people that know what a mapped or sum types are is strikingly low, let alone some of the more advanced concepts or even tsconfig.

I've always thought that typescript is in the real of technologies that developers use for years but never really master such as css. Maybe not as severe as css, but it's the same direction.