DEV Community

Gleb Irovich
Gleb Irovich

Posted on

1 1

What is the most challenging thing in Typescript?

Top comments (8)

Collapse
 
glebirovich profile image
Gleb Irovich β€’

I personally find it very challenging to manage similar interfaces, while using proper naming and accounting for type safety. A good example can be having a GetDto which contains id (and some other fields) vs PostDto which has less field, but in the end describes the same object. What’s your take on that? Any suggestions? Would you use omit with only one interface, optional fields or maintain two separate interfaces ?

Collapse
 
alaindet profile image
Alain D'Ettorre β€’

Searching the whole internet for the import statements people always omit in examples "for brevity".

Collapse
 
glebirovich profile image
Gleb Irovich β€’

Could you elaborate on that, I am not sure if I got your point?

Collapse
 
alaindet profile image
Alain D'Ettorre β€’

Sometimes you find examples on blogs and they omit all import statements to save some space and then you find yourself wondering on the internet trying to understand where those types come from

Collapse
 
dbeardionaire profile image
David Beard β€’

Getting rid of any

Collapse
 
glebirovich profile image
Gleb Irovich β€’

Why do you usually have to introduce anys in your code?

Collapse
 
akashkava profile image
Akash Kava β€’

The one and only one most challenging thing about TypeScript is, accepting it as a product of Microsoft and liking it for the features ignoring the hatred due to some past events of Microsoft.

Collapse
 
glebirovich profile image
Gleb Irovich β€’

Haha ok. And anything feature-wise?

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay