Dan Vanderkam

effectivetypescript.com · Personal blog · on HN since 2020

Dan Vanderkam, author of the book Effective TypeScript, writes about TypeScript's type system, its features, and its tooling.

What HN saysHN commenters recommend his Effective TypeScript book as a good, framework-agnostic starting point and cite his post arguing unsoundness rarely matters in practice.
22HN people shared it
13linked it in comments
16stories submitted
518story points
6 months agolast shared
2020people per year2026

Most-shared posts

  1. 1
    The Seven Sources of Unsoundness in TypeScript (2021)
    7 people · 2 points · first shared 2022 · discussion on HN
  2. 2
    The Saga of the Closure Compiler, and Why TypeScript Won
    3 people · 1 points · first shared 2023 · discussion on HN
  3. 3
    Homepage
    3 people · first shared 2020
  4. 4
    What's TypeScript compiling? Use a treemap to find out
    1 people · 406 points · first shared 2022 · 140 comments on HN
  5. 5
  6. 6
  7. 7
    TypeScript 5.5: A Blockbuster Release
    1 people · 3 points · first shared 2024 · discussion on HN
  8. 8
  9. 9
  10. 10
  11. 11
    A TypeScript Perspective on Go
    1 people · 2 points · first shared 2022 · discussion on HN
  12. 12
    The Golden Rule of Generics
    1 people · 1 points · first shared 2020 · discussion on HN
  13. 13
    TypeScript and SQL: Six Ways to Bridge the Divide
    1 people · 1 points · first shared 2023 · discussion on HN
  14. 14
    A keyof Puzzle
    1 people · 1 points · first shared 2024 · discussion on HN
  15. 15

What HN people wrote when they linked it

syndicatedjelly · 2024-10-20
About a quarter through this one: https://effectivetypescript.com/ Also, for a deeper, theoretical understanding of functional and generic programmers, I highly recommend Programming Languages Part A by Dan Grossman on Coursera. That single class did more to open my mind about what is a “programming language”, than anything in my career.
akhayam · 2023-04-23
Effective typescript is a good start which is framework agnostic and focuses on the fundamentals: https://effectivetypescript.com/
evilduck · 2020-04-27
Not quite what you're asking for, but I really liked this book since it was beyond introductory material and had concrete examples of what and why to do things: https://effectivetypescript.com
amgreg · 2025-05-17
Yeah nowadays I think non-ClojureScript people use it mostly for legacy reasons or the aggressive minification. Back in the day, aside from the pre-ES5 conveniences I mentioned surrounding inheritance and module bundling, it was also a way for developers to do some basic type enforcement (via JSDoc annotations that the Compiler would check). TypeScript essentially rendered that obsolete. See: https://effectivetypescript.com/2023/09/27/closure-compiler/
zoul · 2024-07-25
In my experience unsoundness is almost never a problem in practice, see here for details: https://effectivetypescript.com/2021/05/06/unsoundness/
brokenbyclouds · 2023-11-18
I think this article does a decent job of highlighting many of the reasons why Closure has fallen into obscurity. https://effectivetypescript.com/2023/09/27/closure-compiler/
trenchgun · 2023-02-28
Sound type system is not one of the design goals of TypeScript https://effectivetypescript.com/2021/05/06/unsoundness/
modestygrime · 2022-12-26
> As well, optional generics are trivially achievable in TS via default type parameters, unless I'm not understanding that section of the article. He links to another post that goes into more detail: https://effectivetypescript.com/2020/12/04/gentips-1-curry/ In particular the question and answer in the comments should make it more clear.
bichiliad · 2022-06-28
If you're going down the rabbit hole of writing complex types, check out Dan Vanderkam's "The Display of Types" post[0]. It goes into how types show up in editors and error messages and such, and has a bunch of tricks for improving type readability. I really wish I read it sooner! [0]: https://effectivetypescript.com/2022/02/25/gentips-4-display/
colinmcd · 2022-05-06
TypeScript's type system is unsound in a mathematical sense: https://effectivetypescript.com/2021/05/06/unsoundness/ Though this has little bearing on practicality which is probably why the original comment is at the bottom of the pile. He's also using a stricter mathematical definition of "type safety" whereas tRPC means it in the colloquial way it's used in the TypeScript ecosystem (that is, a fully typed interface between client and server, ideally that's non-duplicative and inferred directly from your code instead of being manually defined).
spiralx · 2021-07-14
Try "Effective TypeScript" from O'Reilly, every chapter I've read so far has been informative - even when I thought I knew the topic inside-out - and it's well-written for the subject depth. You can read some of the items on the author's site e.g. https://effectivetypescript.com/2020/03/09/evolving-any/ https://effectivetypescript.com/2020/03/24/null-values-to-perimeter/
nextaccountic · 2026-05-16
> TypeScript's decision to embrace existing npm ecosystem and layering .d.ts on top was a very practical decision that made it so successful. I don't think this is the problem. I mean, ok, the first part of the problem is that typescript can't or won't represent at the type level some real world Javascript constructs. But that's understandable since Javascript can get arbitrarily complicated. (you could do a survey on npm and make a type system strong enough for all existing libraries, but this would probably be too complicated to use) So this is not by itself too bad if, for each instance of non-representable APIs, you wrote a wrapper library that called the bad library but gave you a perfectly good API to work with. Similar to how in Rust you are supposed to wrap unsafe libraries with a safer, higher level API on top. (except it' s not about memory safety, but type safety. but the same reasoning applies, it's just lower stakes since UB is not involved) So the other, more fundamental problem is that for some godforsaken reason, Typescript decided it was okay to lie with types. Some operations return the wrong type rather than a more honest type. This is not caused by the fact that Typescript has to work with libraries in npm, it's entirely self inflicted. Elsewhere in the thread someone gave an example: stringArray[0] has type string when it should be string | undefined. This (and all other instances of deliberately lying with types) is why Typescript is unsound.…
chubot · 2023-08-25
I think if you're writing code from scratch, this doesn't really apply -- I'm talking about writing a toy language that doesn't use any libraries at all. (I'm aware of all the terrible experiences people have with TypeScript in the NPM ecosystem. But it's a big, mature tool and you can use it in more than 1 way.) I just noticed the 'deno check' command I'm using turns strict mode on by default, so that's good. https://deno.land/[email protected]/getting_started/typescript All gradual type systems in production use are unsound because they have to interoperate with untyped code, and the dynamic checks to make it sound are too expensive. But code written from scratch doesn't have that issue. I'd be interested in a counterexample -- is there a code snippet that passes the strict mode of the compiler, and doesn't interoperate with untyped code, but produces an unexpected runtime error? I guess by "unexpected" I mean at runtime, and operation is performed on a value which is not allowed, and the program fails I googled and found this -- https://effectivetypescript.com/2021/05/06/unsoundness/ -- not sure I agree with some points, e.g. array out of bounds isn't unsoundness! The OPERATION is legal, but the data isn't, which isn't something that any type system will tell you. Similar to divide by zero -- a runtime error does not imply unsoundness.

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close