Live data from Hacker News

TypeScript 7

devblogs.microsoft.com

181–190 of 321 posts

Re: TypeScript 7

#182

Remember when people would argue about how types weren't worth the effort? I love TypeScript, if nothing else for how it's been able to popularize types.

I have personally had three conversations (2 online, 1 in person) where the other person has said, almost verbatim, “I have never had a typing error in JavaScript”. Two of these people were people whose work I respected, so it could not understand how they could possibly hold that position.

It isn't wrong exactly. JS is famous for generally just trying to do something semi random instead of giving you a typing error.

That's the difference between "having a typing error" and "having an error due to typing".

well kinda

Re: TypeScript 7

#183

Remember when people would argue about how types weren't worth the effort? I love TypeScript, if nothing else for how it's been able to popularize types.

Type systems just used to be bad. Anything that forces you to use a class hierarchy to represent an "OR" type (sum types) is painful to work with. Modern languages like TypeScript / Rust / Swift / Kotlin that have sum types are dramatically much nicer.

Algorithm W is 40 years old and HM has vastly better ergonomics than TS's types.

Why certain approaches didn't catch on until recently, or ever, is an interesting thing to think about but "we didn't know how" is not the story here.

Re: TypeScript 7

#184

Remember when people would argue about how types weren't worth the effort? I love TypeScript, if nothing else for how it's been able to popularize types.

I don't recall anyone disliking types . Lots of people disliked static typing , or more directly static, explicit typing . For instance, I've been around many conversations over the years where people would say goofy things like they couldn't use Python because it's untyped. That's insane: Python is strongly typed. It's also dynamically typed, which is a different dimension. There are some genuinely untyped languages…

[deleted]

Re: TypeScript 7

#186

Remember when people would argue about how types weren't worth the effort? I love TypeScript, if nothing else for how it's been able to popularize types.

In 2004 we solved the types for JS with ECMAScript 4 (or ActionScript 2.0).

Unfortunately this was in the middle of browser wars, so no one cared about the standards and all of that work was lost like tears in rain.

Around that time I attended MS conference where they introduced IntelliSense and it was a forming experience for myself. You could do actual programming basically with , , arrow keys and .

"x = " and there are only two variables in the scope with the same type so IDE will present them to you in a drop down and you can already think about the next line.

Fast forward to ~2015 when I'm working on Angular project. The whole idea feels like a caricature Chinese whispers of an OOP framework. Each component is divided into three files, all of them have to identify themselves using a magic string, and that string has to be manually entered into each file.

There are couple of type systems, like the one from Facebook, but no one is using them. And everyone claims that OOP and types are the thing of the past.

Part of that corelates to a joke I was making back in 2013, soon after Apple killed Flash and everyone started doing JS everywhere. Major companies where posting job offers for senior javascript devs asking for 5-7 years of experience. But someone who was doing JS for 7 years in 2012 has all his career focused around gluing together jquery plugins.

Anyway, I'm as well glad that we finally did a full circle and finally have some sanity in the industry...

Re: TypeScript 7

#188

Remember when people would argue about how types weren't worth the effort? I love TypeScript, if nothing else for how it's been able to popularize types.

I don't recall anyone disliking types . Lots of people disliked static typing , or more directly static, explicit typing . For instance, I've been around many conversations over the years where people would say goofy things like they couldn't use Python because it's untyped. That's insane: Python is strongly typed. It's also dynamically typed, which is a different dimension. There are some genuinely untyped languages…

> I've been around many conversations over the years where people would say goofy things like they couldn't use Python because it's untyped.

I'm not sure I would go that far, but I would definitely say that I remember many, many moments where a Python codebase hit critical mass and the amount of time I spent documenting and checking types exploded. It wasn't really about static, explicit typing, so much as "once my tools (IDE) are taken into account, how much time am I spending trying to reason about correctness?" Reasoning about types was the main contributor to that with Python before type annotations.

Re: TypeScript 7

#189
post #81

Earlier quoted context omitted.

That's also true of Python, though, which is traditionally considered a strongly typed language. I'm increasingly convinced that "strong/weak" has no useful meaning. Some people regularly use it interchangeably with "static/dynamic", others use it to vaguely refer to how much casting exists in a language, or how easy it is to transmute a value of one type into a value of a different type. There is no academic definit…

My understanding of weak typing is about allowing automatic type conversion. “3” + 1 === “31”, 1 + “3” === 4. Strong typing doesn’t auto convert.

Pretty much. There's probably better examples but using some of what's come up here so far: python is strong+dynamic, javascript is weak+dynamic, typescript is weak+static*, java is strong+static.

* Maybe. Not quite sure about "weak" for this one, but I think it makes sense because you can just lie to typescript and then after compilation it just runs as javascript.

Re: TypeScript 7

#190

Earlier quoted context omitted.

Do you think Bun's migration was irresponsible?

I don't think irresponsible is the right word, but it has drastically reduced Bun's appeal. All the tools we use have a brand to them, and Bun basically changed their brand overnight to "reckless" in my eyes.

bun has never been fit for production, at least not for load bearing business apps. it’s been haunted by segfault bug reports since the early days, and i personally hit at least one a week when im doing lots of bun stuff. im excited for bun with less segfaults
Post reply on HN