Live data from Hacker News

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

chiragswadia.medium.com

91–100 of 400 posts

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

#91

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.

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

Can I esk exactly how you're considered senior if you've not worked on any projects large enough to warrant type checking?

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

#92
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 another developer in your codebase left a hole somewhere you won't be able to rely on your types, you'll get runtime errors and you basically ruin the capability to reason around your code - it's slow (hopefully deno's efforts will bring some news in that regard)

TL;DR: TypeScript should be much stricter and don't compromise with JS.

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

#93

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 w…

As another lead/senior dev, I've found that onboarding hires that know some TS into a TS codebase is a hugely slicker process than onboarding people into a pure JS codebase, simply because the typechecker can do the overhead of having to check each call etcetera.

The issues you are having sound like teething issues but as someone who's worked with TS for years I've found they aren't hugely difficult to overcome, either with @types packages, or writing declarations, or declaring module (and having an "unsafe" library that people use with care).

> I don't use code hinting. In fact, I find it irritating.

I mean that's a personal preference, but if you're a lead dev and you have people starting work on a codebase they have little experience with, it's a godsend because they aren't totally blind.

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

#94
I have a theory that TypeScript was not actually invented for frontend developers, it was created for non-frontend developers who were forced to deal with the frontend, and hated JavaScript.

That's also why I think it's very funny that JavaScript developers are starting to use TypeScript on be backend, i.e. Deno.

You are using the patch to JavaScript that backend devs needed to make JavaScript more like backend languages in the very place that the languages it is trying to be like already exist. It's ludicrous.

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

#95

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 solve…

This is my problem with TS. The underlying JavaScript peeks it's gross head through the cracks way too much. I end up not bothering with types since they're often wrong at runtime anyway.

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

#96

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.

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

#97

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 de…

> Senior probably means they've been doing JS for decades before TS was invented.

JS has only been around for 25 years. I’m a “Senior person” and I’ve been seriously working with JS for less than 5 years.

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

#98
post #67

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’d consider myself senior. I’ve been using Javascript since it was beta. I like Javascript. I don’t mind TypeScript. I mean, it’s nice and all but it doesn’t strike me as the be-all that others make it out to be. Maybe I just don’t use it for the types of project for which it was designed. It’s like I’m a metal worker and I get along fine with a ball peen hammer. You come along and give me your claw hammer with grea…

I understand the sentiment, but a better comparison would be if your tool of choice had to be shared between everyone on your team.

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

#99

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 guess static first is a chore because at that point you have no idea what invariant or structure is required for the task. After prototyping you know where to tighten the bolts.

> you have no idea what invariant or structure is required for the task

In my experience, in general, if you don't already have an idea, you should probably be spending the up-front time thinking about it. If we're talking React/Redux, then carefully thinking through both data representation and what goes into components' properties/states helps a lot for designing a clean and understandable structure.

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

#100
Two downsides to TS: an extra step to transpile, and having to write shims when it bugs out and can't verify an external declaration.

Upsides? When tuned to its most pedantic settings I've uncovered a handful of bugs that would have otherwise launched.

That's worth far more than a few tiny annoyances. tslint > jslint.

Post reply on HN