DEV Community

Discussion on: More time coding, less time debugging. Interfaces in TypeScript applications

Collapse
 
marwaneb profile image
Marwan El Boussarghini

Thanks a lot for the article 👏🏽 I didn't know you could actually implement interfaces in TS.
I must reckon I'm not a huge fan of OOP in general since it adds a lot of boilerplate to the code, how often do you interfaces?

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

It's not about how many lines of code you write, it's about code quality so there's OOP to give you a more secure implementation. Tests adds a lot of boilerplate too but with unit tests and end to end test you could ensure your application still works after an update, which leads to less time loss seeking for bugs, more application quality to your customers and more efficient team work...

You can emulate OOP features on JS such interfaces and static typing using Typescript or writing it with Kotlin and compile it to js, this last option i think is best so it leads you to a more maintainable and scalable project.

Collapse
 
keevcodes profile image
Andrew McKeever

currently there are several applications utilising TS where I am, most of our interfaces are applied to form input, however there is legacy react components using objects for state handling that are also constructed with interfaces.