Live data from Hacker News

TypeScript is now officially 10 years old

coderoasis.com

31–40 of 207 posts

Re: TypeScript is now officially 10 years old

#34
post #9

>TypeScript never set out to build a separate, distinct, and prescriptive language. Instead, TypeScript had to be descriptive. Sadly, the majority of people writing Typescript rarely care about descriptive and readable code these days. Somehow the focus shifted from using types to better understand complex systems through the code itself , to writing whatever polymorphic union type abomination that yields the best In…

This. Probably every TS codebase I ever worked in had zero to none function- or inline docs with people always claiming "documented by TS". I call that BS, and you can see that in their projects. "Typescript codebase" became the equivalent of "generic low quality codebase" imo. I'll never understand why people need a programming language inside a programming language and refuse simplicity (i.e. using jsdocs, which ha…

I tried jsdoc + JavaScript for a while to minimise the distance between me and the browser, but in the end TypeScript was just the easier choice. Less documentation to type, and the checks are better. I found that using TypeScript basically like JavaScript + jsdoc delivers the best value. I avoid any advanced TypeScript features as TypeScript is just not a proper statically typed language.

Re: TypeScript is now officially 10 years old

#37
Typescript was my stepping stone into the world of Rust.

Even before Deno made it easy, it was straightforward enough to configure a simple tsconfig and just run tsc. Much like cargo, there is a lot to be said for "it just works" tooling - especially for beginners or even new programmers.

It is probably fair to say it is one of the most influential and impactful languages of all time. There's even the future possibility of much of its type syntax being absorbed back into JavaScript: https://github.com/tc39/proposal-type-annotations

Re: TypeScript is now officially 10 years old

#38

So what is the best book (under 250 pages!) to learn TS?

If you're comfortable with JS, you don't need a book to learn TS.

There are two main resources I would recommend:

- for those who prefer written content, the TypeScript Handbook [1]

- for those who prefer video content, the first couple videos of Jack Herrington's No BS TS series [2]

Other than that, just start using it. My main advice would be that your TS code should look as much like JS code as possible, ie don't explicitly type everything, just rely on inference where possible. Basic generics can be useful occasionally, but most of the "Type Challenge" type stuff is only really useful to library developers.

[1] https://www.typescriptlang.org/docs/handbook/intro.html

[2] https://www.youtube.com/watch?v=LKVHFHJsiO0&list=PLNqp92_EXZ...

Re: TypeScript is now officially 10 years old

#39
post #9

>TypeScript never set out to build a separate, distinct, and prescriptive language. Instead, TypeScript had to be descriptive. Sadly, the majority of people writing Typescript rarely care about descriptive and readable code these days. Somehow the focus shifted from using types to better understand complex systems through the code itself , to writing whatever polymorphic union type abomination that yields the best In…

I've had a very different experience than yours with the Typescript codebases I've encountered, which were mostly well designed.

I have no doubt codebases with polymorphic union type abominations exist, but I wouldn't say they are the majority, far from it in my experience.

It also seems to me those are a case of "problem lies between chair and keyboard", not a fault of the language. Bad code can be written in any language.

Re: TypeScript is now officially 10 years old

#40
post #37

Typescript was my stepping stone into the world of Rust. Even before Deno made it easy, it was straightforward enough to configure a simple tsconfig and just run tsc. Much like cargo, there is a lot to be said for "it just works" tooling - especially for beginners or even new programmers. It is probably fair to say it is one of the most influential and impactful languages of all time. There's even the future possibil…

> There's even the future possibility of much of its type syntax being absorbed back into JavaScript: https://github.com/tc39/proposal-type-annotations

... as comments. Which superficially resemble the syntax of type hints but do nothing. Which has to be one of the worst language design decisions of all time.

Post reply on HN