News for hackers. Stuff that matters.
Re:TypeScript is terrible for library developers by david422 on Tuesday August 23, 2022 @04:18PM (#32570899)
> Just using JS and letting things break without knowing it?

And if types change, and it still works, it's basically working by accident.

Re:TypeScript is terrible for library developers by arinlen on Tuesday August 23, 2022 @06:47PM (#32572589)
> And if types change, and it still works, it's basically working by accident.

So the Liskov substitution principle now passes off as "working by accident"?

Re:TypeScript is terrible for library developers by oivey on Tuesday August 23, 2022 @05:18PM (#32571649)
That’s a pretty underspecified comment for a static typing enthusiast. You’re referring to polymorphism.

And to be completely clear: you can have safe polymorphism without type hierarchies via things like type inference.

Re:TypeScript is terrible for library developers by latchkey on Tuesday August 23, 2022 @04:20PM (#32570937)
If types change, it doesn't compile and I can't do a release in CI.

I don't consider that working.

Re:TypeScript is terrible for library developers by david422 on Tuesday August 23, 2022 @04:49PM (#32571272)
I'm agreeing with you here. If you use plain JS and change the underlying types that are being passed around, but things are still working, you're basically getting lucky.
Re:TypeScript is terrible for library developers by latchkey on Tuesday August 23, 2022 @04:55PM (#32571387)
Ok, got it. Apologies.

If you write comprehensive unit tests for your javascript, that should effectively also work too... this is what ruby developers pretty much had to do.

We can see that over time based on the decline of ruby popularity in general, that fell out of style though. It is too easy to make a mistake and everyone was just duplicating what a compiler does for us.

I can't tell you how many hours I would sit there pair programming with other ruby developers just trying to figure out what 'type' an object is. Mind boggling, but it was good to get those high paid consulting hours.

Re:TypeScript is terrible for library developers by cutler on Tuesday August 23, 2022 @07:37PM (#32573059)
RubyMine to the rescue.
Re:TypeScript is terrible for library developers by latchkey on Tuesday August 23, 2022 @08:42PM (#32573601)
We were using that and it is indeed excellent (along with most of JetBrains IDE products). It starts to fall down on all the meta programming we were dealing with. With a dynamic meta programmed DSL, there is only so much RM can deal with.