Search code examples
typescriptclassinterfaceextendsimplements

Why Typescript allows implements abstract class?


I'd reading about typescript's class and abstract class and I did find something very interesting.

Typescript allows us to implement classes.

I even created a stackblitz project to test it.

Anyway, I already found the general differences here, and what is its behavior in typescript here.

I'm aware that it can be used to create mock for tests.

Why typescript allows it, if in other very popular languages (Java, C#,...) it is 'forbidden'? Is There any other important application of this feature?


Solution

  • Before you asked this question I didn't think about, but after I read your question it didn't let me go because I didn't know an answer as well, so I simply asked a typescript lang (core) dev via twitter and I got a reply so I will leave it here.

    enter image description here

    Twitter Source

    expressed in a simple way: "if it works it ain't stupid" and they didn't disallow it because it works