Re:Functions and algorithms implemented purely with TypeScri...
by jongjong on Wednesday July 05, 2023 @09:18AM
(#36600046)
It's not the same because maintainable JavaScript code essentially always converts to maintainable TypeScript code. Adding type annotations to existing JavaScript code won't make it harder to maintain. However, maintainable TypeScript code will not necessarily convert to maintainable JavaScript code after removing the type annotations.
TypeScript makes it easier to maintain bad code; it allows you to take on more technical debt but it's still tech debt and it will still need to be repaid eventually; the more you allow your debt to grow and the more you delay repayment, the more interest you will need to pay.
Anti-patterns are the same in JS and TS; tight coupling and low cohesion is bad, complex interfaces are bad, unclear separation of concerns is bad, poor encapsulation is bad.
Why not just say no to tech debt if can build the product just as fast without it?
TypeScript makes it easier to maintain bad code; it allows you to take on more technical debt but it's still tech debt and it will still need to be repaid eventually; the more you allow your debt to grow and the more you delay repayment, the more interest you will need to pay.
Anti-patterns are the same in JS and TS; tight coupling and low cohesion is bad, complex interfaces are bad, unclear separation of concerns is bad, poor encapsulation is bad.
Why not just say no to tech debt if can build the product just as fast without it?