top | item 46573001

The Concise TypeScript Book

237 points| javatuts | 1 month ago |github.com

61 comments

order

SilverSlash|1 month ago

I don't know if I'd call a book with 61 chapters "concise".

locknitpicker|1 month ago

It didn't included the JavaScript subset, so that's pretty concise.

kertoip_1|1 month ago

What I miss in this book is the reasoning.

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|1 month ago

Determining 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.

locknitpicker|1 month ago

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

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

primitivesuave|1 month ago

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)

wk_end|1 month ago

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.

throwthro0954|1 month ago

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

throw_await|1 month ago

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

tkiolp4|1 month ago

Please 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.

okaram|1 month ago

They have a PDF in the downloads, and an epub one if you have an ebook reader like a kindle or kobo

phplovesong|1 month ago

I 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

skybrian|1 month ago

I assume you meant that the TypeScript compiler is being rewritten in Go. (At first I read it as something entirely different.)

Tade0|1 month ago

Same 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.

llmslave3|1 month ago

Or Lua... :>

fallinditch|1 month ago

Thanks 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'.

doodlesdev|1 month ago

Unfortunately 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.

MORPHOICES|1 month ago

[deleted]

WillAdams|1 month ago

The 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/

(originally developed at: 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.

d4mi3n|1 month ago

What you describe sounds a lot like Diátaxis[1], which is a strategy for writing and organizing technical documentation. It categorizes docs into one of four categories: tutorials, explanations, how-tos, and references.

Category is derived from a fairly simple heuristic: whether the content informs action or cognition, and whether the content serves the reader’s application or acquisition of a skill[2]. I’m a fan and it’s simple enough that most anyone can learn it in an afternoon.

1. https://diataxis.fr/

2. https://diataxis.fr/compass/

auggierose|1 month ago

You have an interesting commenting style. ~

Lots of sentences occupying an entire paragraph.

Sometimes ending with "~". Usually (always?) your posts end with a question.

You are clearly using some sort of framework for your posts.

Care to elaborate? ~

shakabrah|1 month ago

Please take your slop comments elsewhere. We are trying for something different here on HN.

embedding-shape|1 month 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|1 month ago

I 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.