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
131–140 of 207 posts
Re: TypeScript is now officially 10 years old
#132Earlier quoted context omitted.
Wait until you try a language that was supposed to have a decent type system from the beginning!
I like type systems as you can design with types and check things tie together before even running the code. This gives you very fast iteration cycles compared to CMD-R refreshing the browser/code. Some issues with TS are: - There is no hard guarantee at runtime as everything is partially/optionally typed (including your deps). - The types are not used to produce faster code at runtime (like in a compiled language).…
You can get very close if you place fine-grained, well tested, type guards at IO boundaries, wrap poorly typed or overly dynamic dependencies, and have good discipline about internal boundaries. It’s a lot of work up front in a greenfield project, but it really pays off.
> The types are not used to produce faster code at runtime
Not directly, but in my experience good up front interface design tends to produce either immediately optimal JS (eg it tends to be monomorphic) or makes optimization much easier (as it makes any refactoring easier).
Edit:
> I like type systems as you can design with types and check things tie together before even running the code. This gives you very fast iteration cycles compared to CMD-R refreshing the browser/code.
I’d be remiss not to emphasize this! And not just skipping the reload cycle, it lets you skip a whole lot of test runs too. Type error in editor? Yep, those tests are gonna fail too.
Re: TypeScript is now officially 10 years old
#133Earlier quoted context omitted.
Right? The argument that static/strict typing mostly catches trivial bugs isn't an argument against the value of that language, and yet people seem to think it is!
I have to disagree. Adding the types will increase the number of the characters/lines of code which with a 80-char formatter limit can make functions look almost gibberish at a glance. Do that on a whole codebase and it becomes a mess to look at.
Re: TypeScript is now officially 10 years old
#134Earlier quoted context omitted.
Wait until you try a language that was supposed to have a decent type system from the beginning!
I like type systems as you can design with types and check things tie together before even running the code. This gives you very fast iteration cycles compared to CMD-R refreshing the browser/code. Some issues with TS are: - There is no hard guarantee at runtime as everything is partially/optionally typed (including your deps). - The types are not used to produce faster code at runtime (like in a compiled language).…
Re: TypeScript is now officially 10 years old
#135Earlier quoted context omitted.
Microsoft always had great tooling
> great tooling "go to definition" -> goes to type definition Microsoft makes it intentionally impossible to get anything done in their ecosystem without having "great tooling".
Java does it too?
Re: TypeScript is now officially 10 years old
#136Earlier quoted context omitted.
> 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.
well I can, I wrote a year-long js project that I abandoned as refactorings gradually turned into eternal bug-fests. I started from scratch in typescript, and the project is now 3x the dead project, with none of the bugs. and refactorings have become painless, with the compiler tools and editor telling me what I must fix up. There may be a special breed of programmers who need no such help, but I have yet to meet the…
Of course with a big, venerable project the balance changes drastically. But an experienced single-person project should be doable with javascript for a long while and may even get to MVP faster by focusing on things that are essential.
Re: TypeScript is now officially 10 years old
#137Earlier quoted context omitted.
Right? The argument that static/strict typing mostly catches trivial bugs isn't an argument against the value of that language, and yet people seem to think it is!
I have to disagree. Adding the types will increase the number of the characters/lines of code which with a 80-char formatter limit can make functions look almost gibberish at a glance. Do that on a whole codebase and it becomes a mess to look at.
Still even with TypeScript if types makes your functions ugly, then it shows the complexity of the code. Often it also suggests sensible refactoring that without types would not be apparent.
Re: TypeScript is now officially 10 years old
#138Earlier quoted context omitted.
So, 90% of the world GDP?
Yes In the US though, compensation for software developers is very bi-modal. You have the “enterprise shops” that start off around $80K and max out in the mid $100s and the “tech companies” that start out in the mid $100s and end up in the $350K+ range. Most of the 2.7 million developers in the US are on the “enterprise dev” side. If you have a choice, you want to be on the “tech company” side if you care about your…
Re: TypeScript is now officially 10 years old
#139TS on frontend feels like devs making their editor choice (VScode) a hard dependancy
Re: TypeScript is now officially 10 years old
#140Earlier quoted context omitted.
Right? The argument that static/strict typing mostly catches trivial bugs isn't an argument against the value of that language, and yet people seem to think it is!
I have to disagree. Adding the types will increase the number of the characters/lines of code which with a 80-char formatter limit can make functions look almost gibberish at a glance. Do that on a whole codebase and it becomes a mess to look at.