Live data from Hacker News

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

chiragswadia.medium.com

81–90 of 400 posts

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

#81

For me, I can handle the lack of static typing when I'm doing small scripts, like if it's going to be 100 lines or so of Python (my go-to language if I need to test some math out in a sandbox or do some file manipulation on my system). I might actually be a little faster in writing those scripts because of the lack of typing. Once it starts getting any bigger than that, though, static typing really catches and points…

Seems like an easy cutoff is when you add a build step as opposed to just including your script on the page. If you need to use Webpack for a project, you might as well add TypeScript as well.

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

#82

It's probably worth taking a step back and interrogating why the actual "Why was I Anti-TypeScript?" a little bit more and use it as an opportunity for broader self development. The author didn't use and understand something, and rather than trying to they instead just defaulted to rejection. It's midly disapointing seeing this in people who label themselves as "Senior".

Senior probably means they've been doing JS for decades before TS was invented. They got along just fine without it for so many years, why rock the boat now? Or maybe it is more of a Senior person has a ton of work to do and not enough time to do it in so there isn't time left to learn a whole new way of writing JS. Or maybe many of the errors TS is meant to catch, the Senior developer has already learned over the decades not to do that bad thing, so they don't see the need to adopt TS. Or maybe they are just jaded and tired of learning new things.

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

#83

Earlier quoted context omitted.

I mean, Coffeescript was fairly widely used at its peak, and now it's all but dead. Front-end fads are fickle. At least TypeScript has Microsoft backing it so they'll likely continue to support even if the rest of the webdev world moves on to the next shiny object.

I don't think I've ever heard of any in-production, large apps in Coffeescript, even from when it was at its peak. I know of a handful of companies that tried it and even enjoyed it quite a bit but none of it was for mass consumption. Typescript, meanwhile, is used for hugely popular apps, is used by very large companies, has Microsoft's full backing, etc. The two are not comparable. Edit: Clearly I'm misremembering…

PagerDuty’s front end was 100% coffeescript until at least 2016

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

#84

For me, I can handle the lack of static typing when I'm doing small scripts, like if it's going to be 100 lines or so of Python (my go-to language if I need to test some math out in a sandbox or do some file manipulation on my system). I might actually be a little faster in writing those scripts because of the lack of typing. Once it starts getting any bigger than that, though, static typing really catches and points…

> I also think static typing has the benefit of enforced self-documentation a bit, so other developers know just by checking the type what sort of data they should expect to see in there, and not trying to give it garbage to begin with. Granted good variable naming and proper documentation would alleviate that, but that's never been fully consistent at any organization I've ever worked for.

I don’t think naming is fully alleviated by static typing; however, on the other hand, static typing allows IDEs to offer better refactoring capabilities, since they can presumably build such functionality on top of the compiler’s structured syntax tree representations.

As an example, lately I fairly frequently find myself using VS Code capabilities to rename TS identifiers as my code evolves. It always handles correctly the scope and everything, I’m sure it’d be more error-prone with plain JS.

Agreed about statically typed code being more self-documenting in general. It’s a bit of a double-edged sword in that it may give an illusion that your project is easier to understand than it actually is, but it usefully shifts the focus of documentation from minute details of code itself to subject domain specifics and how you represent them in your architecture.

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

#85

It's probably worth taking a step back and interrogating why the actual "Why was I Anti-TypeScript?" a little bit more and use it as an opportunity for broader self development. The author didn't use and understand something, and rather than trying to they instead just defaulted to rejection. It's midly disapointing seeing this in people who label themselves as "Senior".

I think the skepticism of new shiny things is healthy. Of the set of things that exist, most things are worse than the things one already uses/prefers. Most new things solve a specific problem that may not overlap with the problems one is trying to solve. With software development, a huge part of the puzzle is tooling (as the article points out), so even if typescript is obviously superior as a language, the tooling needs to catch up before it's a reasonable/useful alternative. In this case, the tooling quality, enabled by the static typing, shot typescript way past the thing it was replacing.

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

#86

Earlier quoted context omitted.

I mean, Coffeescript was fairly widely used at its peak, and now it's all but dead. Front-end fads are fickle. At least TypeScript has Microsoft backing it so they'll likely continue to support even if the rest of the webdev world moves on to the next shiny object.

I also have fond memories of painstakingly converting hundreds of coffeescript files back to JS. There's something to be said for using the native language.

Browser support and consistency got a lot better.

JavaScript was a minefield of compatibility problems. Many intentional, cough: Microsoft.

Jquery was awesome because it dealt with most of that

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

#87

Earlier quoted context omitted.

I don't think I've ever heard of any in-production, large apps in Coffeescript, even from when it was at its peak. I know of a handful of companies that tried it and even enjoyed it quite a bit but none of it was for mass consumption. Typescript, meanwhile, is used for hugely popular apps, is used by very large companies, has Microsoft's full backing, etc. The two are not comparable. Edit: Clearly I'm misremembering…

Wasn’t CoffeeScript the preferred way to write JS in Ruby on Rails for years?

HAML and coffeescript.

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

#88
post #66
post #33

Earlier quoted context omitted.

Typescript is not accepted. How AngularJS stuck on 1.* is the best proof, and an illustration for the problem. Pretty serious people are working in Angular community, it's immensely popular in the enterprise webapp space, so I will not take the "Ah, it's just amateurs who are stuck there." It adds to countless attempts of other transpiled *scripts to extend Javascript. They, and Coffeescript in particular, are good h…

I wrote AngularJS 1.x in TypeScript in an enterprise application. Being "stuck there" ("there" meaning pure JS for Angular 1.x) is a choice.

I'll second that. We used AngularJS 1.x with TypeScript in an enterprise application.

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

#89
I was hesitantly open to TS when the hype was first ramping up. The team I was on (and I've seen this in lots of code elsewhere too) was doing stuff like this:

  declare let myColor: Color | undefined;
Suddenly everything turned into Java with signatures cascading endlessly. I'm not blaming TS, it's more of a.. lack of faith to make the full jump? Or limitation of the underlying Javascript? This problem should be solved with having multiple function signatures, in the example above one with and one without the Color param.

I've been toying with Erlang for years, once I grokked how they flow control can be done via different method signatures, the Other Way started looking really inadequate.

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

#90

I'm a senior developer and I've never touched TypeScript and don't have any desire to unless I have no choice. I haven't worked on any projects that were large enough to warrant type checking or where I felt it would make a huge difference. Also I find it a bit verbose and ugly and I'm just not a fan of pseduo Javascript languages that need to be compiled down into JavaScript.

Same. Lead dev here.

Part of my problem stems from the lack of typed libraries across the JS ecosystem. Party supported typing leads to more issues, I've found.

Then there's the IDE. I don't use code hinting. In fact, I find it irritating. So, I draw no benefit from TS in this regard.

Then there's the cryptic error messages. They've gotten better over the years but I always seem to spend more time debugging TS than writing code.

And finally, I just don't run into the kinds of errors people talk about solving with TS.

That said, I did enjoy the strong typing that AS4 provided back in the day. But TS is intolerable to me and I've worked with it for years.

Post reply on HN