Live data from Hacker News

TypeScript is now officially 10 years old

coderoasis.com

191–200 of 207 posts

Re: TypeScript is now officially 10 years old

#191
post #183

Earlier quoted context omitted.

“My field” is a 20+ year MS ecosystem developer from C++/MFC, VB6, .Net Compact framework, .Net Framework, .Net Core, etc. Right, and in that field you might be correct (I don't know but I'll take your word for it). It is however not the entire software industry. As I said, very few new companies that aren’t “legacy” shops are choosing .Net. I'm a game developer and the most popular game engine (Unity) uses c#. The n…

You realize you are echoing exactly what I’m saying? Governments are the definition of “legacy” Windows shops. The whole thing I’ve been saying is that new initiatives outside of historical Windows shop are not adopting .Net even though it’s been cross platform and open source since 2016. The new startups and newer companies that avoiding Windows like the plague are also avoiding .Net. In the US, the companies that p…

If that's what you meant ("c# is unpopular among the best paying tech companies") I can accept that. But what you originally wrote that I disagree with is:

    That unfortunately hasn’t helped C# become more popular outside of 
    Microsoft legacy shops even when it did go cross platform and open source.
Where I work is very much not a microsoft legacy shop (a game dev startup) & we use c#. This is hardly unusual.

Re: TypeScript is now officially 10 years old

#192
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.

There (kind of) is another option. It is called Rescript. But to be honest will probably never take off... :( For me it has by far the best type system for a script language. It is based on Ocaml. Its syntax is easier to read than Ocaml and as powerful as Ocaml if not more by aiming at JS world. One great feature you can take a look at to see how simple and powerful the type system is is Pattern Matching / Destructuring [1] and its "switch".

https://rescript-lang.org/

[1] https://rescript-lang.org/docs/manual/latest/pattern-matchin...

Re: TypeScript is now officially 10 years old

#193
post #180

Earlier quoted context omitted.

It's normal not to be aware of the types when encountering code for the first time, or after a long absence. Your described experience is the rare exception when working with third party vendors, on long lived projects, or with teams that are not trivially small.

So the benefits are only available once or twice, but the code is going to be verbose forever. If I were to come up with environment where it is guaranteed to be a net positive it would be a company with lack of boundaries between teams and a lot of churn. Essentially TS averages out engineers in your team. You're going to be slower, but more predictable. Your 10x engineers will become 5x, but 1x will become 2x.

The verbosity is not a meaningful performance impediment. It takes a trivial amount of time to write, and a trivial amount of time to read.

If the a team can distinguish between an average and excellent programmer's performance by the time it takes to read or write type information then I expect the skill and experience breadth within the team was already narrow.

Re: TypeScript is now officially 10 years old

#194
post #180

Earlier quoted context omitted.

So the benefits are only available once or twice, but the code is going to be verbose forever. If I were to come up with environment where it is guaranteed to be a net positive it would be a company with lack of boundaries between teams and a lot of churn. Essentially TS averages out engineers in your team. You're going to be slower, but more predictable. Your 10x engineers will become 5x, but 1x will become 2x.

> Essentially TS averages out engineers in your team. You're going to be slower, but more predictable. Your 10x engineers will become 5x, but 1x will become 2x. It’s the other way around. For more experienced engineers TypeScript is a huge productivity multiplier: you can fly around a large code base with ease, making changes all over. More experienced engineers also probably have some history with other statically t…

> TypeScript is a huge productivity multiplier

See, I've heard it multiple times. And yet nobody is able to provide evidence. Surely if effects are so huge it's should be easy to prove. We're commenting on the article that says TS is 10 years old. Where is the hard evidence?

When you ask about real examples of productivity boost, TS folks shift focus to bugs (why not talk about bugs in the first place?). When you ask about critical bugs, TS folks shift focus to IDE autocompletion. When you press for evidence, goal post is constantly being moved.

Whenever you see bold claims and no evidence other than personal stories for several years, you should immediately attribute it to placebo (or other biases).

> you can fly around a large code base with ease, making changes all over

Not really, unless you're talking about bloated codebases. Huge codebases are huge due to domain complexity, you can't be making changes all over without extensive testing. What does help is having a modular codebase with good boundaries. If you already have it, TS benefits are tiny. If you don't, you're better off spending time making it modular than switching to TypeScript.

> TypeScript still a productivity boost

And yet if you talk to popular library maintainers in Python/JS community, a lot of them say that types have slowed them down. Some of them still believe it was worth it, because it helps users of those libraries. But again, see how the goalpost is being moved?

Re: TypeScript is now officially 10 years old

#195
post #83

Earlier quoted context omitted.

It actually is. TS is like a force multiplier for shit devs. All the worst code I've ever seen has been in TS and within the last 5 years. The average code quality has fucking plummetted in that time too, it's not just the worst offenders.

I'd argue it's not actually TS that causes this. There are just a lot of unskilled devs. You mention "within the last 5 years" without also taking into account the absolute explosion in the popularity of becoming a software dev in the last 10 years. So of course theres going to be a lot of bad (and some good) devs. With TS being one of the literal most popular languages in use right now, of course a lot of bad code w…

> I'd argue it's not actually TS that causes this. There are just a lot of unskilled devs.

But a lot of unskilled devs is status quo. It will never change: each year more folks are starting their career than becoming good devs.

If your plane doesn't fly, you can't blame gravity.

Re: TypeScript is now officially 10 years old

#196

Earlier quoted context omitted.

>your definition of a “sane” developer is not as universal as you may have thought Where I'm from, sanity has historically been the minority opinion, so we don't really have a word for this, but I think the English one is... "gaslighting"? "TS is a superset of JS", "there are 4/5 lights", "this line is longer/shorter", etc. (Look those up if you haven't, Microsoft marketers surely have.) What I'm saying is, I am well…

> Where I'm from, sanity has historically been the minority opinion You are conflating santity for your subjective opinion. I guess your post might have been received better if you showed more awereness of that. > That's completely subjective. Yes. Which is why i prefixed "Personally I...". I'm clear about this being my opinion, not an universal truth. > Personally, I don't know how to fix a piece of code without bei…

>I guess your post might have been received better

You assume that I'm primarily optimizing for that.

I optimize for being able to express my opinion in sufficient detail that people actually bother to try to show me things that I don't know, just because they're mildly outraged at my audacity to say, "but some things are very not ok" :)

>Where I'm from...

...they stopped putting people in cages not even for believing outrageous things, but for holding outrageous disbeliefs, about a generation ago. So it's also about maintaining the capability to express dissent.

>I'm clear about this being my opinion, not an universal truth.

God forbid I claim to know any universal truth! Therein lies the way to True Madness. Anything anyone says can at most be their subjective truth - if they can reproduce from memory the things that make them believe what they're saying. Snippet battle was fun

>If the compiler tells me I'm passing a string to a function expecting a number, I find that error pretty easy to grasp, and I don't need to run the code to know how to proceed from that error-message.

And if the compiler happens not to? Back to runtime validation, considering priorities it remains ad-hoc, so the mess gets even unholier.

(where's my authomatic runtime validation layer based on parsing the type definition? holla at me)

>Javascript as a language has lots of quirks. Lots of quirks which are unexpected to most developers not coming from Javascript. That is to say, Javascript behaves differently than most other programming-languages. >I'm not saying it's wrong or "not sane", but programmers coming from other languages will make assumptions and those assumptions will be wrong for "plain" Javascript, leading to buggy code.

I'm not saying it's wrong for JS to be like that either (I put forward a couple good reasons for the contrary and know a couple more), but I am saying that it is already "not sane" enough - in the sense that the hidden assumptions and unexpected behavior impair one's immediate ability to reason about the codebase.

The transpiler ecosystem doesn't help with that, either - TS, Babel, CLJS or whatever else, if I have to run scripts through a compiler it smells like someone isn't managing complexity right and it sure as hell it ain't every downstream developer who just uses whatever has the most mindshare (so that the quirks are at least googlable). Though I guess you could approach it from that angle too

>rather trust the correctness of your own code, than having a compiler check it for you

Rather verify the correctness of my code by running it, than trust the half-assed third-party static analyzer that's manipulated itself between my editor and runtime, yes

>Where Typescript tries to force you to make formal declarations for your code, you find those limiting or getting in your way.

That's a deficiency of TypeScript. The only option is not to use TypeScript, which is in many cases not an option.

>Me (and many others) on the other hand, are just human, and we like a compiler to tell us about obvious errors in our code without having to discover them at runtime, or even worse, in production.

I'm all in for this! I just wish it worked well enough to justify the drawbacks.

>To me it seems like you're one of those people who prefers to work with all the quirks that Javascript provides and considers those to be good things,

Prefer to know things that will not become invalidated by progress? Who doesn't. I already have to reason about a whole stack of "quirks" from the user's brain to the CPU and back. I would've preferred for Microsoft not to add 2322 more of those out of sheer community goodwill but there you have it.

>But if you (and that's up to you!)

It's up to me on my down time. Rest of my life it's up to the economy lol

>decide to write your code using types and allow TypeScript to check them

"decide to buy into the TypeScript language and ecosystem" because "writing your code using types and allowing TypeScript to check them" by manually writing a .JS + .D.TS is also not a practical option.

>That's why people use it.

My guess is most devs adopted it on their down time to stay relevant, "join us or fade away" hahahaah

>at least you know that your code in isolation is unaffected by whatever dynamic runtime it will end up being run on.

Where did that even come from. You mean like how it's now 4x harder to publish an isomorphic library because the CJS->ESM migrations and TypeScript doing its own things with modules have mangled the packaging surface in further sanity-reducing ways

>Be a superstar if you like.

One does not reach a position of power simply by doing what one wants. You also gotta tell others what not to do :)

Re: TypeScript is now officially 10 years old

#197

I feel like I am the only one in the world not liking typescript. It is not that I don't like types, it is what those types do to the readability of the codebase in terms of verbosity. My original programming language was Java but I switched to Node.js because I liked the simplicity of the code written in it. Nowadays every Javascript project seems worse than a Java project in terms of verbosity. My main gripe with p…

I tried to find an example to see what you mean, take this file - https://github.com/microsoft/vscode/blob/main/src/vs/editor/... The typings on the class variables are useful to have. There are also typings on the function signatures, not a huge deal. In the method bodies there are almost no typings as all of it is already inferred. Seems pretty readable to me.

How about this one: https://github.com/microsoft/vscode/blob/427530e884b33be2451...

  export interface IDomEvent {
   (element: EventHandler, type: K, useCapture?: boolean): BaseEvent;
   (element: EventHandler, type: string, useCapture?: boolean): BaseEvent;
  }

Re: TypeScript is now officially 10 years old

#198
post #194

Earlier quoted context omitted.

> Essentially TS averages out engineers in your team. You're going to be slower, but more predictable. Your 10x engineers will become 5x, but 1x will become 2x. It’s the other way around. For more experienced engineers TypeScript is a huge productivity multiplier: you can fly around a large code base with ease, making changes all over. More experienced engineers also probably have some history with other statically t…

> TypeScript is a huge productivity multiplier See, I've heard it multiple times. And yet nobody is able to provide evidence. Surely if effects are so huge it's should be easy to prove. We're commenting on the article that says TS is 10 years old. Where is the hard evidence? When you ask about real examples of productivity boost, TS folks shift focus to bugs (why not talk about bugs in the first place?). When you ask…

The strong evidence in support of static typing for productivity and security is well known and a trivial Google search away.

Re: TypeScript is now officially 10 years old

#199
post #194

Earlier quoted context omitted.

> TypeScript is a huge productivity multiplier See, I've heard it multiple times. And yet nobody is able to provide evidence. Surely if effects are so huge it's should be easy to prove. We're commenting on the article that says TS is 10 years old. Where is the hard evidence? When you ask about real examples of productivity boost, TS folks shift focus to bugs (why not talk about bugs in the first place?). When you ask…

The strong evidence in support of static typing for productivity and security is well known and a trivial Google search away.

Which you conveniently not linking because you know it's going to be controversial at best.

Get off the high horse, static vs dynamic has been a never ending debate since the dawn of time.

Just because you side with one religion doesn't automatically make it "well known". Learn to recognize your own biases.

Re: TypeScript is now officially 10 years old

#200
post #191

Earlier quoted context omitted.

You realize you are echoing exactly what I’m saying? Governments are the definition of “legacy” Windows shops. The whole thing I’ve been saying is that new initiatives outside of historical Windows shop are not adopting .Net even though it’s been cross platform and open source since 2016. The new startups and newer companies that avoiding Windows like the plague are also avoiding .Net. In the US, the companies that p…

If that's what you meant ("c# is unpopular among the best paying tech companies") I can accept that. But what you originally wrote that I disagree with is: That unfortunately hasn’t helped C# become more popular outside of Microsoft legacy shops even when it did go cross platform and open source. Where I work is very much not a microsoft legacy shop (a game dev startup) & we use c#. This is hardly unusual.

And where you work is probably on the “enterprise” side of the bimodal enterprise dev/tech company compensation bimodal distribution.

https://news.ycombinator.com/item?id=33140210

When talking about compensation, it might as well be an “enterprise shop”

Just in case you don’t read the link above, that’s not meant to be derisive. It’s just a pure statement of fact.

There are plenty of “startups” that locate in major cities in the US outside of tech hubs, find a bunch of MS developers to write the next CRUD SaaS app and pay enterprise dev wages. I should know, I spent over two decades working for them

Post reply on HN