Re:TypeScript is terrible for library developers
by mrkeen on Tuesday August 23, 2022 @03:22PM
(#32570013)
> In strongly-typed programming languages, which includes Typescript, figuring out the types is not something that's done after the fact.
Too broad a statement. There's loads of value in having a compiler figure out types for you after/when you write the code.
Re:TypeScript is terrible for library developers
by Chabsff on Tuesday August 23, 2022 @03:34PM
(#32570204)
Hard disagree as far as the portions of it that are part of the user-facing public interface are concerned.
But granted, as a general rule you are correct. I was referring specifically to API interfaces.
Re:TypeScript is terrible for library developers
by overgard on Tuesday August 23, 2022 @04:25PM
(#32570986)
If you're talking about type-inference, sure, I guess it's fine.
If you're talking about figuring out what types you're going to accept, you should absolutely be defining that on your own up-front. If you don't even know what your types are how is an end user going to figure it out?
If you write a library in TypeScript, determining what types are present as part of the interface is one of the very first thing that should be done.