|
|
|
|
|
by claytongulick
1560 days ago
|
|
What I'm referring to is non-trivial function definitions. Things with optional parameters that can accept a wide variety of types, async callbacks and async variadic return types. The hoops you need to jump through to make the compiler happy are absurd. |
|
I have no doubt that a sizable portion of these functions' bodies is dedicated to figuring out which type each of our input variables represent (from our wide variety). So now instead of having our editor/compiler help us out, we are now actually writing code to figure it out ourselves... this is more absurd (and less efficient).
And FWIW, using union types makes it trivial to denote that a function can accept a wide variety of types in a type-safe way. But guess what you will be doing first thing in the function body? Discriminating that union!