News for hackers. Stuff that matters.
Re:Code is Engineering, Types are Science by ferdowsi on Sunday June 27, 2021 @02:20PM (#27653850)
It's because when developers are handed an abstraction like static types, they will tend to go as far as possible to create overengineered solutions using that tool, creating complexity that becomes a problem in its own right.

TypeScript in particular has been adding features at far too fast a pace, creating wild amounts of complexity in the type system. This is from one popular type library. Type theorists may enjoy this. I personally would not if I am onboarding to a new codebase and trying to understand this at a glance.

  export type CamelCasedPropertiesDeep<Value> = Value extends Function
  ? Value
  : Value extends Array<infer U>
  ? Array<CamelCasedPropertiesDeep<U>>
  : Value extends Set<infer U>
  ? Set<CamelCasedPropertiesDeep<U>> : {
    [K in keyof Value as CamelCase<K>]: CamelCasedPropertiesDeep<Value[K]>;
  };
Re:Code is Engineering, Types are Science by __float on Sunday June 27, 2021 @02:34PM (#27653985)
With a powerful type system, I think you tend to see examples of libraries that fall along a spectrum of how deep into the type system they're willing to go.

This is an example of the farther end, but "ideally" as a user of the library, the actual complexity would be hidden, and it "just works" for you.