DEV Community

Discussion on: TypeScript is the Only Programming Language you Need to Learn. One language to rule them all!

Collapse
 
eecolor profile image
EECOLOR

TypeScript has quite a flexible type system. However to express some more complicated types requires quite a lot of effort and knowledge.

Important things that I think are missing:

  • Type inference for arguments based on usage
  • A way to express intent (for example: the function expects a User) combined with actual usage (for example: the function expects something that has a name property). It would be great if any type system would combine this. Note that this is explained better here: youtube.com/watch?v=YR5WdGrpoug
Thread Thread
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

I think you're attributing more features to a type system than it should actually have. When you start adding predicates like "having a name field" you're ending up back at set theory.

Thread Thread
 
eecolor profile image
EECOLOR

Might be. I was thinking more along the lines of Nominal typing vs Structural typing and in a sense a mix between the two.