6 ms·
The Concise TypeScript Book
- gnabgib 9mo agoPopular in 2023 (215 points, 91 comments) https://news.ycombinator.com/item?id=36641634 https://news.ycombinator.com/item?id=36641634
- SilverSlash 9mo agoI don't know if I'd call a book with 61 chapters "concise".
- locknitpicker 9mo agoIt didn't included the JavaScript subset, so that's pretty concise.
- forgotpwd16 9mo agoThey aren't book-length chapters. E.g. https://gibbok.github.io/typescript-book/book/strictnullchecks/ https://gibbok.github.io/typescript-book/book/strictnullchec... is one paragraph, https://gibbok.github.io/typescript-book/book/void-type/ https://gibbok.github.io/typescript-book/book/void-type/ is 1 sentence plus 1 3-line example. Near all of those "chapters" seem to be bit more than that. 1~2 paragraphs plus 1~2 code examples.
- logicallee 9mo agoyou're not meant to scroll ahead, the intention is to create a time sink in each chapter. I figured this out after reading the first chapter forever, then I was like "wait a second this is the concise book? how can I read the introduction forever?"
- raincole 9mo agoI've read the introduction part and I've seen no "time sink." I genuinely don't know what your comment means. Do you really have a hard time reading the introduction part?
- locknitpicker 9mo agoI was wondering what is the community's opinion on the official TypeScript Handbook https://www.typescriptlang.org/docs/handbook/intro.html https://www.typescriptlang.org/docs/handbook/intro.html
- wk_end 9mo agoSpeaking 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.
- throwthro0954 9mo agoI prefer this over everything else I've seen so far, it actually is concise.
- throw_await 9mo agoGood, but it only gives a very brief overview, no explanations
- epolanski 9mo agoI 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.
- tresil 9mo agoI 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-minutes-oop.html https://www.typescriptlang.org/docs/handbook/typescript-in-5...
- 9mo ago
- phplovesong 9mo agoI know why typescript "succeeded", but always wonder what kind of web we would have if infact Haxe had become more popular for web in the early days. My guesstimate is we would have had bundlers in native code much, much earlier, and generally much faster and more robust tooling. Its only now we see projects like esbuild, and even TS being written in a compiled language (go), and other efforts in rust. Also it would have been interesting sto ser what influence Haxe would have had on javascript itself
- llmslave3 9mo agoOr Lua... :>
- forgotpwd16 9mo agoThen comparison will've been Haxe to TypeLua rather TypeScript. Typing addition seems inevitable.
- Tade0 9mo agoSame could be said about Java Applets or Flash and, in a way, about Elm. We've been there and this approach doesn't work. The creators of TypeScript realized early on that people don't need yet another ecosystem, but a migration path that won't pause development.
- phplovesong 9mo agoThats true, but comes with a cost. TS has become an incredibly complex language, even it only provides types. Thats being said is will always lack features as it only "javascript". Haxe has a more robust, but simpler typesystem, that comes from ocaml. Haxe also compiles to C++ so making native tools would have been a breeze. TS sits at the top chair, but there is many "better" options out there, like Elm (even its kild of a dead languge) and ReScript/ReasonML etc. TS is good, but will never be a perfect language for javascript. It will always be a mediocre option, that is growing more and more complex in every new release.
- tkiolp4 9mo agoPlease provide a PDF as well. I cannot read books in HTML format because I need to keep track of where i left. That means I either have to leave the browser tab open (but this is prone to accidentally closing it) or I need to bookmark every progress, which creates noise in my bookmarks. With a PDF I simply leave it, the reader remembers my last page. I also have a sense of progress with pdf.
- MORPHOICES 9mo ago[dead]
- WillAdams 9mo agoThe thing is, documentation isn't a monolithic thing --- it really needs to be sub-divided/categorized into subsets which are useful to specific categories of folks working on, or working with, a project: https://diataxis.fr/ https://diataxis.fr/ (originally developed at: https://docs.divio.com/documentation-system/ https://docs.divio.com/documentation-system/) divides into 4 types of documentation: - Tutorials - Explanation - How-to Guides - Reference My own documentation got much better when I broke it up along those lines.
- pstuart 9mo agoAgreed, but IMHO it should be layered so one can enter at the highest conceptual level and drill down and back up so there's a continuous flow of understanding.
- WillAdams 9mo agoMy experience is that if there's too much documentation for a given representation, a not insignificant number of folks will not read it --- divide and conquer seems to be a workable approach.
- pstuart 9mo agoI agree -- my point was to have the details linked in a drill down manner so that one can skim the high level parts but easily expand upon any topic directly from where it's being referenced.
- WillAdams 9mo agoI would like to see a UI/toolkit which implements that easily and works well.
- embedding-shape 9mo ago> Some of the benefits of TypeScript: > Access to ES6 and ES7 features > Cross-Platform and Cross-browser Compatibility Damn, I wasn't aware that since I avoid TS, I cannot use ES6 and ES7, and my vanilla JavaScript doesn't run in all browsers :( I guess over-hyping the technology that the book is about is to be expected, but it still leaves a slightly sour taste in my mouth when people oversell what they're talking about it.
- chrisldgk 9mo agoI think the point is that you can write your code using ES6 and ES7 and the TypeScript compiler allows you to output ES6 or ES5 compatible code if you want to make sure it runs in older browsers as well. You can do that with non-TypeScript ES code as well but you’re bound to use another transpiler. With TypeScript you get it „for free“ since you need to compile your code either way.
- embedding-shape 9mo agoAh yeah, kind of like how I get a drink for free if I get the hamburger menu, even if it costs more? Kind of weird perspective, but I can accept that it's something zealots tell themselves so "we're doing it differently" actually computes for them.
- troad 9mo ago> it's something zealots tell themselves Don't be like this. Don't spit bile at people because they have different needs and preferences to you. As I understand it, the TS compiler can translate newer JS features/syntax into backwards-compatible polyfills for you, automatically. I don't really use TS myself, but I'm not going to pretend like that isn't a useful feature.
- embedding-shape 9mo agoI have used JS before TS entered the scene, and being able to transpile features/syntax like that is not a TS innovation, nor only available in TS. That's why flagging that as something "you get for free, since you added a compiler anyways" feels dishonest. Ultimately it's true, but if that's what you're out after, then adding TS to your project is going way above and beyond just "transpiling new syntax to old syntax".
- fallinditch 9mo agoThanks for sharing, this is useful. To the author, congrats and thank you. I have one piece of feedback: When you are typing Typescript on your keyboard you are typing types using a strongly typed language. Some definitions would be useful to novices: 'type' as a noun or verb, in the mathematical context + the notion of 'strong'.
- kertoip_1 9mo agoWhat I miss in this book is the reasoning. https://gibbok.github.io/typescript-book/book/differences-between-type-and-interface/ https://gibbok.github.io/typescript-book/book/differences-be... So we know there are types and interfaces. One support declaration merging, one does not. Both can extend others, but in different ways. But why? Why there are two of them? When should I use them? Is one better than the other?
- derangedHorse 9mo agoDetermining the motivation for design decisions is outside the scope of what any external party can and/or should do. The most the author could do is echo what's in the docs (if present), or give their own guess on why things are the way they are.
- anamexis 9mo agoGiving guidance on which one should be used and when is well within the scope of external parties.
- reverseblade2 9mo agoAnd I have this roadmap if anyone interested in https://nemorize.com/roadmaps/typescript https://nemorize.com/roadmaps/typescript
- dorfsmay 9mo agoWhat's the "Sign in to study" button? Nothing happens when I click on it. If I click above it takes me to am explanation of the subject.
- reverseblade2 9mo agoIt should in theory allow you to answer the questions associated with the section. Let me cross check.
- reverseblade2 9mo agoYep it is broken, will be fixing 5 min.
- reverseblade2 9mo agoFixed. please retry. Thanks for reporting.
- straws 9mo agoWould also recommend https://types.kitlangton.com/ https://types.kitlangton.com/ as a companion — sometimes many examples can illustrate the point more succinctly than text.
- doodlesdev 9mo agoUnfortunately most of the content hasn't been updated for two years straight, which is quite a lot considering how much ECMAScript and TypeScript have been changing in recent years. I guess it's still a good reference, though.