Comment

Comment by slackingoff2017

I don't see a ton of value in this. The main use case mentioned (preventing use of functions with wrong parameter order) can be worked around using the common 'options' object pattern that everyone uses for functions with a lot of parameters already

Still a neat feature I guess, but IMO it's not worth the additional mental overhead of implementing it.

A lot of problems in JS and it's typed derivatives go back to it's 'structural' type system where every object is a key-value collection and objects with the same keys and values are interchangeble.

I really wish the ES standard would just introduce a new variable type that has nominal typing and ditches the prototypical inheritence chain. You could only use it with new code but since transpilation is the norm these days that doesn't matter much

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton