Live data from Hacker News

How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

chiragswadia.medium.com

331–340 of 400 posts

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#331

I have noticed a lot of people who grew up only using dynamic typing languages are discovering static typing for the first time and proclaiming it to be the "new way forward" or something. Kids...

What exact value does this comment add other than some weird attempt to give off some air of superiority? A lot of of people are "discovering" TypeScript because it is the first widely used and well supported attempt to bring static typing to a language that is currently the only mainstream option for programming to web.

They mean that people who have been back and forth multiple times over many years don't see the value in TypeScript. This is totally consistent with my 15 years of experience working on many different complex projects and having gone back and forth between JS and TS.

TS helps if the project is really poorly written... But that's not something to aspire to.

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#332

I had the opposite experience. I like languages with static types a lot and I used to be a fan of TypeScript. After using it for a few OSS projects and professionally, I came to the conclusion that, if I need types, I'll use a real statically typed language if I need types and JS for what doesn't matter. TypeScript works but: - it's a major pain to work with if your dependencies don't have type definitions - if anoth…

TypeScript is unnecessary. Type incompatibility is not a big problem at all... It's the easiest kind of bug to find and fix. The simplest tests will typically catch those bugs even when the tests are not explicitly looking for them.

On the other hand, issues related to parallel async state mutations which involve race conditions are very common in complex projects and are very challenging to debug. Type incompatibility issues are a walk in the park. You don't need a type checker for that. Just because your boss is incontinent doesn't mean that you also need to wear an adult diaper!

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#333

Although I like the actual language of TypeScript more than JavaScript, it still doesn't feel useful enough to justify its usage. Computers' native language is Assembly but we rarely use it and prefer to code in C/Python/whatever because this is so much easier (+ portable). Browsers' native language is JavaScript and it isn't much harder nor less powerful than TypeScript, nor does it provide a seriously different per…

The value of TypeScript is a function of the codebase size, size of team, and length of time for maintaining this codebase. If you're an individual, putting together dinky little web sites that you don't need to maintain for years - the value of TypeScript over JavaScript isn't as pronounced. If you have a web application that counts hundreds of thousands of lines of code, maintained by team of developers over many y…

This is incorrect. This is just repeating popular rhetoric.

Well designed projects are broken up into manageable, individually testable modules... So codebase size is an anti-pattern to begin with. As for time, you think waiting 15 additional seconds each time you want to test something doesn't add up and waste time? What about having to type up all these extra type definitions? You could have spent that time writing more test cases.

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#334

Earlier quoted context omitted.

This comment and many others in this thread seem to be missing something. I see a lot of anger here or blame on the author for deliberately choosing to not use types, but I think the author actually does a very admirable job explaining what's going on in their head: "... concepts like Generics felt very hard to understand ... every piece of code is strongly typed and overwhelming. Even simple code like below scared m…

>The author isn't claiming to have had an informed opinion of types. They're saying that they found learning about types to be difficult and stressful. That's a real problem that I think people who understand types forget. Respectfully, its really hard for me to wrap my head around this mindset. When I wrote my first line of code, almost 10 years ago, one of the very first concepts I learned was types. You know the b…

The opposite for me. Typing makes zero sense. I know what I'm doing with my variables so why do I need to specify a type? Why can't the computer figure this out? Isn't that what computers are good at?

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#335

Earlier quoted context omitted.

JQuery dealt with DOM and browser stuff. Coffeescript dealt with syntactic language stuff. I can't think of a case where Coffeescript helps with the same thing JQuery does, although it may exist.

Yeah as best I can tell, Coffeescript was a thing because Ruby was very popular at the time, and some Ruby devs had to write JS but they wanted to write Ruby.

I was never a fan of the Rubyisms in Coffeescript. But it's sad nothing else ever implemented the YAMLisms.

Typing up constants in Babel JS is so much uglier than it needs to be.

But Coffeescript also introduced things like arrow functions that bind `this` to JS. Transpiling to ES5 allowed JS to evolve.

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#336
post #174

> I always felt that adding types to the functions/variables and satisfying the TypeScript compiler is an over-engineering and not providing any meaningful benefits. I honestly find this attitude horrifying. I'm glad the author was able to move on from this, but it is utterly pervasive in some parts of our industry. As far as "engineering" goes, specifying your types is about as low-hanging, basic a step as you can t…

Oh come on, this is a discussion probably older than both of us put together. And we probably both know that the discussion devolves into where/what kind of tests are written. I'm on your side in the static type system debate, but you must realize that the responsible part of the other side delegates the responsibility to exhaustive testing.

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#337
post #174

> I always felt that adding types to the functions/variables and satisfying the TypeScript compiler is an over-engineering and not providing any meaningful benefits. I honestly find this attitude horrifying. I'm glad the author was able to move on from this, but it is utterly pervasive in some parts of our industry. As far as "engineering" goes, specifying your types is about as low-hanging, basic a step as you can t…

This comment and many others in this thread seem to be missing something. I see a lot of anger here or blame on the author for deliberately choosing to not use types, but I think the author actually does a very admirable job explaining what's going on in their head: "... concepts like Generics felt very hard to understand ... every piece of code is strongly typed and overwhelming. Even simple code like below scared m…

> a very admirable job explaining what's going on in their head

As someone who followed the author's path, this is spot on, and also what I recognized in the article. Everything else you said is spot on too, I just wanted to call this out as part of the article's would-be audience.

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#338

Earlier quoted context omitted.

This comment and many others in this thread seem to be missing something. I see a lot of anger here or blame on the author for deliberately choosing to not use types, but I think the author actually does a very admirable job explaining what's going on in their head: "... concepts like Generics felt very hard to understand ... every piece of code is strongly typed and overwhelming. Even simple code like below scared m…

>The author isn't claiming to have had an informed opinion of types. They're saying that they found learning about types to be difficult and stressful. That's a real problem that I think people who understand types forget. Respectfully, its really hard for me to wrap my head around this mindset. When I wrote my first line of code, almost 10 years ago, one of the very first concepts I learned was types. You know the b…

> Respectfully, its really hard for me to wrap my head around this mindset.

> When I wrote my first line of code, almost 10 years ago, one of the very first concepts I learned was types.

Well, that's great for you. When I wrote my first line of code, almost 20 years ago, the first thing I learned was string interpolation. Then a long, somewhat embarrassing course in what happens when you interpolate strings that weren't of the same "type". If you're introduced in any kind of self-taught way to programming, and you start with dynamically typed languages, you're doing stringly typed stuff.

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#339
post #257
post #246

Earlier quoted context omitted.

They're describing how they felt before learning about types.

Yes. Like I said. > I'm glad the author was able to move on from this, but it is utterly pervasive in some parts of our industry.

It's entirely possible you have a language barrier, but you should know that there's a meaningful difference between past and present tense when you're representing what other people said.

(Edit: added clarification of which speaker's tense was important)

Re: How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan

#340
post #278
post #174

> I always felt that adding types to the functions/variables and satisfying the TypeScript compiler is an over-engineering and not providing any meaningful benefits. I honestly find this attitude horrifying. I'm glad the author was able to move on from this, but it is utterly pervasive in some parts of our industry. As far as "engineering" goes, specifying your types is about as low-hanging, basic a step as you can t…

> As far as "engineering" goes, specifying your types is about as low-hanging, basic a step as you can take. How do you come to such a conclusion when there have been many languages whose success was specifically tied to the fact that they were dynamically typed? Doesn't that indicate a pain point? > If this is "over-engineering" then I think that says a lot about how much thought, design and engineering goes into so…

> How do you come to such a conclusion when there have been many languages whose success was specifically tied to the fact that they were dynamically typed? Doesn't that indicate a pain point?

How do you come to the pain point conclusion about static types, rather than prior art static type systems, when the vast majority of tooling around the most popular dynamically typed language explicitly dedicates resources and visibility to its most popular static type system?

Post reply on HN