Re:Remove TypeScript
by jeppester on Wednesday September 06, 2023 @06:06PM
(#37412070)
In our team it's causing a lot of confusion an inconsistency that types and interfaces overlap 90% in functionality, but have different syntaxes.
You can find many articles trying to explain which is best under which circumstances, but there are no correct answers.
I would wish for TS to deprecate one of the syntaxes (probably interfaces because they read as statements rather than expressions), and instead extend the other with the 10% functionality that would be lost.
For instance a type could be declared as open, to make it possible to reopen and extend it.
Re:Remove TypeScript
by Rapzid on Friday September 08, 2023 @03:25PM
(#37438227)
I even saw a Youtube video recently making a strong case that types are almost always the better option unless you run into a few niche use cases like needing interface merging.
You can find many articles trying to explain which is best under which circumstances, but there are no correct answers.
I would wish for TS to deprecate one of the syntaxes (probably interfaces because they read as statements rather than expressions), and instead extend the other with the 10% functionality that would be lost.
For instance a type could be declared as open, to make it possible to reopen and extend it.