Live data from Hacker News

TypeScript is now officially 10 years old

coderoasis.com

51–60 of 207 posts

Re: TypeScript is now officially 10 years old

#52

Earlier quoted context omitted.

that's maybe the second or the third most important factor. the first is aggressive marketing that microsoft does for its products.

That unfortunately hasn’t helped C# become more popular outside of Microsoft legacy shops even when it did go cross platform and open source.

It's used in Unity game development

I think Godot also supports it

Re: TypeScript is now officially 10 years old

#53

Earlier quoted context omitted.

Banks, insurance companies, government agencies, “enterprise development”.

So, 90% of the world GDP?

Yes

In the US though, compensation for software developers is very bi-modal. You have the “enterprise shops” that start off around $80K and max out in the mid $100s and the “tech companies” that start out in the mid $100s and end up in the $350K+ range.

Most of the 2.7 million developers in the US are on the “enterprise dev” side. If you have a choice, you want to be on the “tech company” side if you care about your compensation.

For context: because of path dependencies and bad career choices, I spent most of my career from 1996 - 2020 on the “enterprise dev” side and only got into $BigTech by pivoting to cloud consulting (enterprise dev + cloud + a shit ton of yaml/HCL PowerPoint slides and diagrams)

Before anyone “well actually”’s me with numbers they are directionally correct on the enterprise dev side in most major cities.

Re: TypeScript is now officially 10 years old

#55

Typescript is for big project and team collaboration. JS is still my choice for personal or small project. Fast!

> Typescript is for big project and team collaboration. TypeScript is for any kind of project, it just makes your code safer, easier to debug, easier to read / come back to in the future, etc. > Fast! That doesn't mean anything. Especially for a small project, the TypeScript to JavaScript compilation will take milliseconds, there is no speed impact at all.

My project is small but TS takes 4-5 seconds to compile it from scratch on each run.

The main speed impact is in developer productivity though. If something ain't working right, now I first gotta fix the types before I can see if I've fixed the actual logic.

I imagine if my codebase was more "OOP-y" (i.e. if I replaced every layer of my domain model with 3 layers of dependency injection, turning the whole thing into an inscrutable ball of spaghetti like the cartel wants me to) I could probably iterate without breaking the types.

But for any sane developer having made the mistake to touch TypeScript, the capability to strip the types and run the code with broken types, is essential.

"But then why have types at all?" Exactly. They're a crutch for people who want their IDE to understand the code instead of them.

Re: TypeScript is now officially 10 years old

#56
post #48

I was unsure of Typescript at first, but it has become an absolute joy and absolute pleasure to develop in. I was reluctant to introduce a build step (having got used to the simple refresh cycle of a browser plus vanilla javascript) but I am pleased to say that this is a bit of a non-issue now with modern tooling like esbuild et al. I still avoid NPM like the absolute plague, but the good news is that tooling like De…

Can be said about regular modern JS as well. Whether your project has types or not is not alone going to determine the success of the project.

I personally can’t agree with that. TS catches me writing numerous bugs a day, the structural typing plus static analysis is a superb combination. If your code base is in JS without types, you probably have many bugs, you just don’t know about them. Especially around undefined/null handling.

TypeScript also allows me to refactor fearlessly, which substantially improves the quality of my code as I can do mini-rewrites without worrying about breaking interfaces.

Re: TypeScript is now officially 10 years old

#57
post #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.

...as optional hints that don't require you to buy into a whole new toolchain.

Re: TypeScript is now officially 10 years old

#58
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…

Opposite experience. Rust was my stepping stone into "hey, maybe JS will be better with some degree of static typing?" Yes it would. But not the way TypeScript does it though, and there aren't any other viable options, are there?

TypeScript brands itself a "superset" of JavaScript. In practice, it arbitrarily invalidates completely sensible JavaScript idioms.

Re: TypeScript is now officially 10 years old

#59
post #11
post #2

The post mentions one of the most important factors in TypeScript’s adoption: it launched, from the start, with good tooling.

In my opinion the most important factor was that it is a superset of JS and any valid Javascript code is/was valid TS code. That allowed for gradual adoption and you didn't have to risk going all-in into new technology.

TS is emphatically not a superset of JS. It rejects perfectly valid JS leaving you no recourse other than design your whole architecture around what TypeScript allows. Which is what Microsoft wants of course.

Re: TypeScript is now officially 10 years old

#60
post #11

Earlier quoted context omitted.

In my opinion the most important factor was that it is a superset of JS and any valid Javascript code is/was valid TS code. That allowed for gradual adoption and you didn't have to risk going all-in into new technology.

Also the `any` type [1]. It makes porting an existing project ridiculously easy: just type everything as `any`, and it also gives freedom to the developer to think in code when developing, trusting that they (will) know what they are doing, instead of screaming at the smallest mis-type with annoying bright red squiggly lines. It is so liberating to type a variable as `any` when sketching new code, figuring things out…

And then you have to contribute to a codebase with restrictive ESLint (bleurgh!) configuration, so you can't even try out whether your code works because the tooling disallows you from compiling it as long as it contains "any", and the other devs are like "but muh best practices". So not only you gotta work around TS, you gotta do it invisibly. How did people even live before VSCode's type hint popups covered up the previous line?
Post reply on HN