r/typescript • • Oct 01 '22

Ten Years of TypeScript

https://devblogs.microsoft.com/typescript/ten-years-of-typescript/
190 Upvotes

43 comments sorted by

48

u/lifeeraser Oct 01 '22

People despise Microsoft for many reasons but TypeScript is not among them. Looking forward to the next 10 years <3

11

u/ArnUpNorth Oct 01 '22

i'm not so sure "people despise microsoft". Between vscode, typescript, .net core, their contribution to chrome and how they keep pushing github forward it's hard not to like them from an open source and development perspective.

12

u/Pelopida92 Oct 01 '22

Add Playwright to that list. Currently the most advanced E2E testing tool out there.

0

u/[deleted] Oct 02 '22

[deleted]

1

u/FormerGameDev Oct 02 '22

i've not heard of it either and would like to know, too. I would guess that it's not anywhere near as prissy about a lot of things, though. Cypress can be hell to work with.

1

u/Pelopida92 Oct 02 '22

You are spot on. It has none of the quirks and limitations of Cypress. Also has everything built-in, you don't have to install external libraries for everything, unlike Cypress. Oh and native Typescript support of course. Check out their docs

7

u/r0ck0 Oct 02 '22

i'm not so sure "people despise microsoft".

Any of em? Really?

It's not quite as bad as the days when slashdot was the #1 tech site. But there's still a fuckton of people that are scarred forever and will never get out of that mindset. Spend some time in some linux subs and you'll see it regularly.

I used to be one of em too. Although a lot of their decisions in Windows + Office, and things like how they name + rename their products etc still help keep some of that hate alive, haha :)

2

u/ArnUpNorth Oct 02 '22

Let’s be honest last time I checked the linux subs were full of hate on a wide range of topics 😅 i don’t understand communities which can’t enjoy free and open products without having to spit on commercial ones.

I know that some people hate Microsoft with a passion but I can’t help to notice that younger generations are way more open minded in that regard.

Also i like how in your example you said that renaming products helped keeping that hate alive. This boggles me because I ve seen that arguments and it makes no sense whatsoever. There s nothing mean or evil when a company rebrands, it just means it realigns with the market 🤷‍♂️

But i guess when you want to hate something you always find fuel for that fire.

1

u/Badaluka Oct 02 '22

Now they seem good guys, but back then in Windows 98, Millenium and XP era they were really pushing for closed source solutions that were only compatible with Windows. Wanted to make an app for Windows? You could only use their IDE with their language and imposed limitations, having to write it from scratch for every platform you wanted to work on it.

There was Java trying to be the cross platform solution but it didn't go very well.

They were trying the Apple approach, which was controlling everything they could and to eliminate competition. People hate them mostly for Internet Explorer being incompatible with many common web standards and also because of this policy.

Now they seem to have changed substantially. Maybe they accept Linux and Apple will always be around and they now try to be the most developer friendly platform. They are achieving it because from some polls I saw online people are increasingly using Windows as their main OS for development, that was not the case at all years ago, Linux was developer heaven.

2

u/ArnUpNorth Oct 02 '22

I dont develop in windows at work but a lot of my team mates are and they are really enjoying the wsl2 development experience.

On a side note Microsoft does’t just accept linux it has been one of its main contributors for almost ten years now.

0

u/[deleted] Oct 02 '22

[deleted]

9

u/Badaluka Oct 02 '22

I suppose if they get too much control they'll start becoming evil again. They open source everything and are very friendly only because it was either that or die to Apple and Linux.

Their goal is that developers say "hey I don't need to install Linux to develop anymore! I have the best OS GUI and a good dev environment compatible with even old Linux programs (via WSL)".

If they eat Linux market share they'll still be relevant in the market.

-1

u/tr14l Oct 02 '22

Luckily they aren't competent enough to pull it off. Google is full Linux, and Microsoft kills projects off at roughly 3x the rate that Google does. Their flagship codebases were kludged together. They do massive, buggy releases with lengthy, manual testing processes. The value code-out-the-door above literally anything else. They have poor vision and few original ideas or innovation.

The simple fact of the matter is that Microsoft is in a full-on panic state for their inhouse dev, which is why they keep doing multi-billion dollar acquisitions. So, when they get something to actually work well, they want to wave it around and show everyone as much as possible so they don't lose industry trust, because their entire model requires investors to keep their money with them.

MS is standing on a cliff. They are still relevant right now, but they know it's only a step or two away to become a dinosaur.

1

u/tr14l Oct 02 '22

You named two things across a multi-billion dollar portfolio.

Microsoft has a business model of buying already-prolific technologies and then making them shittier so they can milk it for more money than they bought it for (ala Github and Minecraft).

Great, in their 1000s of projects and products, they made a couple correct decisions (after decades of being chastized, mind you).

"they've changed, they've changed!"

-5

u/FormerGameDev Oct 02 '22

after the bait and switch they pulled on the github ai code plugin, making it subscription now, i'm pretty annoyed by them.

They're still doing the same things they did 15 years ago, they're just doing it alongside contributing to the community.

8

u/Neurotrace Oct 02 '22

What bait and switch? I was involved with Copilot from the first early access drop. It seemed pretty apparent from the start that they would be charging for it as soon as it was ready

84

u/MrStLouis Oct 01 '22

I'm the only TS developer on my team and idk how the hell people code JS without it. Not even with JSDoc or VSCode. Makes me sick to think about

43

u/Cube00 Oct 01 '22 edited Oct 01 '22

Even worst are the ones that try to justify plain JS because it's "faster" to develop because thinking clearly about what you're passing around (or not passing in the case of undefined) is just too hard apparently.

11

u/MrStLouis Oct 01 '22

Ya that's the older people on my team. Especially because jQuery is a big library we work with (old enterprise) and basically all of the api for .val() types return string | string[] the type errors drive people crazy. Or "notepad++ is a perfectly adequate code editor" when they all use VS for dotnet code.

12

u/r0ck0 Oct 02 '22

Or "notepad++ is a perfectly adequate code editor"

Haha, yeah this one is so strange to me. I'm still surprised every time I hear it from actual programmers.

1

u/jackson_bourne Oct 02 '22

Notepad++ has a project viewer, plugins, dark mode, intellisense, etc. etc.

It's not my first choice, but it's not bad if you configure it properly

2

u/r0ck0 Oct 02 '22

I mean I guess it is "adequate" and "not bad", depending on what those things mean exactly.

...but this kinda assumes you're comparing it with like... notepad or something?

Thing is... I've never heard any of them say why they prefer it over anything that's actually commonly considered "good" these days. It's usually a case of them not having actually tried anything else since they moved from something super basic to notepad++ ...like 10 years ago.

When they haven't actually tried the alternatives that the other people are talking about... why defend your one-and-only thing against people who have experience with both?

If you're a full time programmer, a job which requires us to constantly be learning and trying new things... I just find it odd that these people don't spend time trying other stuff for their editor. And it makes me wonder if their actual programming skills have evolved much in the same period too.

11

u/r0ck0 Oct 02 '22

Especially funny is the argument "I don't want to spend time thinking about types".

funfunfunction actually literally said this once when talking about how he doesn't like TS.

I love the guy's videos otherwise, so I was kinda shocked that he said this. Especially given that he's even done a series of videos on Haskell and liked that.

The point of the typing system is not having to "think" about types. Because there's no doubt in the first place. Without a typing system, in some aspects, you're actually "thinking" about types even more, and especially when it comes to debugging.

Your code/data has types regardless of whether it has a static typing system or not. You've gotta "think" about them either way. But I'd rather than "thinking" time be preventative rather than painful debugging and everlasting doubt.

3

u/tyler_church Oct 02 '22

Yeah my least favorite kind of “thinking” about types is when I have to dig through legacy code to figure out what the heck the types even are so I can fix a bug or add a feature!

Much better to just write it down in the first place.

1

u/FormerGameDev Oct 02 '22

add a tsconfig to the project and let vscode infer it for you :D

1

u/FormerGameDev Oct 02 '22

The only time I think about types with Typescript is when there's an error, and that's because the errors are absolutely unintelligible trash as soon as you get beyond the most simple of types.

6

u/[deleted] Oct 01 '22

i just grabbed a new contract and this was exactly what the lead told me (it's faster not to use typescripts and we use proptypes anyway). i just uh-huh'd and took the job anyway because money.

2

u/retief1 Oct 01 '22

That being said, there are definitely times where you know what you have but ts doesn’t, and convincing ts that your correct code is actually correct can be annoying. I think ts is worth that price, but there is a tradeoff there.

10

u/SlaimeLannister Oct 01 '22

On a daily basis, it’s truly mind boggling how much I rely on Typescript to catch my bugs and autocomplete the libraries I’m working with.

9

u/geon Oct 01 '22

I wrote some ts 2020 that I opened up today to add a feature in.

It was a piece of cake. Just one more discriminated union, and ts told me exactly where to add the missing code.

2

u/jsideris Oct 02 '22 edited Oct 02 '22

Before I really got into TypeScript I spent years really in the weeds of JavaScript working on some really hard shit. One thing I'll say is that you get really good at predicting what might break and then diagnosing problems. And not only that, writing code in a safe way that is less fragile.

TS is a huge improvement though.

*grammar

6

u/r0ck0 Oct 02 '22

idk how the hell people code JS without it

The same way people lived without toilets in ye olde days...

You don't miss what you don't know.

The biggest sign of an inexperienced dev (or just stunted/stupid older person) is when they argue against things they have no experience with.

I was that guy in my younger days too. I've mostly grown out of it. But it's fucking weird seeing older people who never learnt this life lesson though.

2

u/[deleted] Oct 02 '22

It took me a bit to understand how to think in TS properly, but holy heck was it worth it. I genuinely cannot understand how people are still religiously attached to plain js. The minor inconvenience you have to work around helps you fix issues you never would have caught otherwise

1

u/mjbmitch Oct 02 '22

It just reminds me of stormtroopers blind-firing around the corner.

17

u/r0ck0 Oct 02 '22 edited Oct 02 '22

TypeScript really was the big thing that got me into static typing, including going on to learn other languages like C#, Rust, Haskell, #F.

But even though they all obviously have stronger runtime typing guarantees... they all fall short compared to TS when it comes to stuff like efficiently creating types from other types.

I use things like keyof typeof, and the util types so often, that I feel very stunted in other "more strongly" typed languages, where you don't have any of this stuff, and you just need to copy and paste or manually write more types to get the power of what TS can do with easy type-munging.

It completely affects the style of code you're going to use in the first place.

I also really really love string literal union types (is there are more succinct term for this?). I find enums annoying in comparison now, and don't even use them anymore.

And I keep finding more and more use cases for when I want special chars in the strings/tokens, which you can't do with an enum key. e.g. Domains and email addresses etc.

I've tried to find them in other languages, but nothing else seems to support them anywhere like TS can.

Personally for almost all of what I do, the compromise on runtime safety with TS vs other proper static languages is actually worth it for all this stuff I'm banging on about here. I miss it all too much in those other languages.

3

u/alliejanej Oct 02 '22

I love this take, and just moving over our production app from JS to TS. The more I use it the more I love it.

And didn’t know about all the Util types! I use Record quite a bit but going to have to learn the other ones. Thanks for the tip!

15

u/[deleted] Oct 01 '22

And what a huge impact on code quality and developer efficient it’s had!

26

u/FullstackViking Oct 01 '22

Typescript single-handedly ushered in my passion for programming.

A perfect blend of approachable simplicity, and a long enough leash to get yourself deep in the weeds.

Combined with the complimentary development of VS Code, it’s a great time to be a programmer!

8

u/[deleted] Oct 02 '22

"Once you start using Typescript, there's no going back to JavaScript"

5

u/bussy-shaman Oct 02 '22

I'm trying really hard to get my team to move to TypeScript from vanilla JS. They have no idea what they're missing.

3

u/solidiquis1 Oct 02 '22

TypeScript made me realize how shit my JS was and I shudder now looking back at how much JS I've written in our codebase before we added TS. There's really no good reason to not use TS.

1

u/Ooyyggeenn Oct 02 '22

There is Typescript and theres also Typescript written by psycopaths which makes the codebase unreadable.

2

u/rcfox Oct 02 '22

I've been working with MikroORM lately, and it is really cool how it can type-check my queries, even within embedded JSON fields. But yeah, the package's source is really hard to read because of all the typing magic going on.