r/programminghorror • • May 27 '26

Javascript Destructuring strings

Post image
887 Upvotes

64 comments sorted by

View all comments

Show parent comment

6

u/ings0c May 27 '26 edited May 27 '26

It does make it a bad language. This is a language design problem.

JS takes the philosophy of "I must never complain about what the developer is asking me to do. It is better to take instructions that make no sense and do something than it is to error"

That results in things like the OP. It would be better for everyone if it just errored, because who wants to do that?

Once you've worked in a language with property type safety, it becomes very clear that it's a better approach than whatever-the-fuck-you-want typing.