|
|
|
|
|
by jameshart
795 days ago
|
|
That’s not the claim. It’s well
commented and formatted so actually quite readable. The claim is that very few could write it. Though I would say that ‘very few’ is a larger group than they think - there are plenty of people doing metatype programming in TS; I’ve dabbled enough that given the problem I could probably tackle it and I know I learned from seeing others do it (because I am far from a typescript professional). So it’s not ‘superhuman’ if many of the humans who have found themselves wanting to work with the typescript type derivation model could have written it. These capabilities - type ternaries and inferred type parameters - were put into TypeScript with a view that humans would use them. The danger here is kidding yourself that this sort of code is beyond human. |
|