Hacker News new | ask | show | jobs
by underwater 1669 days ago
I feel like TypeScript and Flow went down the structural typing path (rather than relying on nominal types) because they were following what was popular in JavaScript at the time, not because it is an unequivocally better solution. The last time I programmed PHP, I didn't feel having to define lightweight classes was a big deal.

The examples you mentioned are interesting because I consider `options` arguments to be a code smell that tends to happen because TypeScript is missing named parameters, which PHP has. And typing JSON messages is far from a solved problem in TypeScript, because there is no widespread solution for runtime type checking.