r/javascript • • Nov 02 '22

Javascript is still the most used programming language in newly created repositories on GitHub

https://ossinsight.io/2022/#top-programming-languages
343 Upvotes

106 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Nov 03 '22

Only if implementing classes in the first place. Otherwise it's far better to have higher level validation on data objects. So I disagree I'm afraid.

1

u/jsr0x0000 Nov 07 '22

Why just when implementing classes? I would argue that function signature checking forces strong edge-case handling, which is particularly useful in functional-first codebases.

Typing on boundaries does not mean that you trust invalid data. It means that *after validating* data, you can set a boundary of trust. Gradual typing allows you to move that boundary little by little.