> When you're working with objects that inherit from each other, use interfaces. extends makes TypeScript's type checker run slightly faster than using &.
In my case however I argue for much stricter designs and only use type even in case of “inheritance” (more accurately composition).
Having such overlapping and for all practical purposes identical behaviour across two keywords feels totally redundant. So I always use type, which is a more natural fit anyway.
I imagine a lot of people are going to disagree with both posts.
From the article:
> When you're working with objects that inherit from each other, use interfaces. extends makes TypeScript's type checker run slightly faster than using &.
In my case however I argue for much stricter designs and only use type even in case of “inheritance” (more accurately composition).
Having such overlapping and for all practical purposes identical behaviour across two keywords feels totally redundant. So I always use type, which is a more natural fit anyway.
I imagine a lot of people are going to disagree with both posts.
(Strangely he posted that article just weeks after I posted mine… https://www.lloydatkinson.net/posts/2023/favour-typescript-t...)