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?
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.
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)
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.
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.
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.
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
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.
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:
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.
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.
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.
SilverSlash|1 month ago
forgotpwd16|1 month ago
locknitpicker|1 month ago
kertoip_1|1 month ago
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
locknitpicker|1 month ago
https://www.typescriptlang.org/docs/handbook/intro.html
primitivesuave|1 month ago
wk_end|1 month ago
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|1 month ago
https://www.typescriptlang.org/docs/handbook/typescript-in-5...
throwthro0954|1 month ago
throw_await|1 month ago
gnabgib|1 month ago
tkiolp4|1 month ago
mr_mitm|1 month ago
okaram|1 month ago
reverseblade2|1 month ago
https://nemorize.com/roadmaps/typescript
dorfsmay|1 month ago
phplovesong|1 month ago
Also it would have been interesting sto ser what influence Haxe would have had on javascript itself
skybrian|1 month ago
Tade0|1 month ago
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
fallinditch|1 month ago
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
straws|1 month ago
MORPHOICES|1 month ago
[deleted]
WillAdams|1 month ago
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
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
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
embedding-shape|1 month ago
> 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