Earlier quoted context omitted.
I personally can’t agree with that. TS catches me writing numerous bugs a day, the structural typing plus static analysis is a superb combination. If your code base is in JS without types, you probably have many bugs, you just don’t know about them. Especially around undefined/null handling. TypeScript also allows me to refactor fearlessly, which substantially improves the quality of my code as I can do mini-rewrites…
> TS catches me writing numerous bugs a day I see this sentiment a lot but I honestly can't think of any non-trivial bugs that TS has caught for me. 99% of the bugs it catches I would see 1 second later when my page hot reloads and crashes.
TypeScript is now officially 10 years old
91–100 of 207 posts
Re: TypeScript is now officially 10 years old
#92I was a bit younger and bolder then; I lamented with the lead developer about how vanilla JS was probably not a good idea for what was to be a large enterprise platform. The response I got back was probably what you would expect from a senior developer receiving criticism from a rather newly minted developer: Oh i've tried Typescript, but it's just SO VERBOSE. I feel like I can't get ANYTHING done, etc. etc. etc.
I've personally been all in on TS from close to day one - around 2013 when I started some very early web development (hooray for the AngularJS/Angular days! /s). It somewhat scratches my ego and has been rather interesting to see the developer mindset change, particularly that of vanilla JS developers of old. Response like ones I had have gone from often negative, complaining about verbosity and I guess frustration with anything different from what they are used to, to overwhelmingly positive. Old guards join us, or fade away, I suppose.
Re: TypeScript is now officially 10 years old
#93Re: TypeScript is now officially 10 years old
#94Earlier quoted context omitted.
I personally can’t agree with that. TS catches me writing numerous bugs a day, the structural typing plus static analysis is a superb combination. If your code base is in JS without types, you probably have many bugs, you just don’t know about them. Especially around undefined/null handling. TypeScript also allows me to refactor fearlessly, which substantially improves the quality of my code as I can do mini-rewrites…
> TS catches me writing numerous bugs a day I see this sentiment a lot but I honestly can't think of any non-trivial bugs that TS has caught for me. 99% of the bugs it catches I would see 1 second later when my page hot reloads and crashes.
Re: TypeScript is now officially 10 years old
#95>TypeScript never set out to build a separate, distinct, and prescriptive language. Instead, TypeScript had to be descriptive. Sadly, the majority of people writing Typescript rarely care about descriptive and readable code these days. Somehow the focus shifted from using types to better understand complex systems through the code itself , to writing whatever polymorphic union type abomination that yields the best In…
The whole reason Microsoft made TypeScript was so that Intellisense would work. Then that became part of the religion and elaborated on with millions of dollars of marketing.
Re: TypeScript is now officially 10 years old
#96>TypeScript never set out to build a separate, distinct, and prescriptive language. Instead, TypeScript had to be descriptive. Sadly, the majority of people writing Typescript rarely care about descriptive and readable code these days. Somehow the focus shifted from using types to better understand complex systems through the code itself , to writing whatever polymorphic union type abomination that yields the best In…
I've had a very different experience than yours with the Typescript codebases I've encountered, which were mostly well designed. I have no doubt codebases with polymorphic union type abominations exist, but I wouldn't say they are the majority, far from it in my experience. It also seems to me those are a case of "problem lies between chair and keyboard", not a fault of the language. Bad code can be written in any la…
Agreed. And in fact, the founders of a project having explicitly chosen TypeScript is often in and of itself an indicator that the team cares about code quality and writing style.
As you say, you can write poorly in any language. But people who care about quality choose TypeScript.
Re: TypeScript is now officially 10 years old
#97As a C++/C#/Java developer I just couldn't deal with Javascript. Since discovering TS its fast becoming my favorite language. I think I might even use in the back end going forward.
Re: TypeScript is now officially 10 years old
#98My main gripe with projects becoming verbose is that the code becomes hard to understand at a glance. Functions that usually could be 10 lines are now 15 lines becomes of the formatter and each line looks more gibberish because everything has a type. You have to manually filter out that noise. The best way I can describe it is that entropy is increased in order to get type safety.
Re: TypeScript is now officially 10 years old
#99Earlier quoted context omitted.
I.e. cringing all the time?
Cringing at compile time safety or what?
Re: TypeScript is now officially 10 years old
#100Earlier quoted context omitted.
> In practice, it arbitrarily invalidates completely sensible JavaScript idioms. Such as?
For one, try redefining a property as a getter/setter pair in a subclass. Also, try implementing a function that takes keyword arguments, some of which are required, and some of which have default values. I'll wait. When you're back I might've remembered some more.
On the second, doesn’t this work?: ‘function foo({ bar = 3 }: { bar?: number })’