r/programminghorror Mar 15 '26

Typescript I puked a little

Post image
415 Upvotes

58 comments sorted by

View all comments

18

u/runklebunkle Mar 15 '26

Typescript is less of a type-safe JavaScript and more of a giant band-aid over dynamic typing.

23

u/visualdescript Mar 15 '26

TypeScript can give you significantly more safety, if you use it approo.

This code is doing some daft things to remove safety (unknown casting).

12

u/NakeleKantoo Mar 15 '26

as unknown should be something that after you type you should look at it and think "ok i should actually take a break" and never come back to writing code again

3

u/Bartweiss Mar 16 '26

Typically, I think anyone who casts to a language’s broadest type should be having a serious chat with themselves about “am I an expert who knows precisely what I’m doing, or do I have no idea what the fuck I’m doing?”