Hasty Briefsbeta

Bilingual

Design duality and the expression problem (2018)

4 months ago
  • #programming
  • #abstraction
  • #design
  • The fundamental trade-off in abstraction design is power vs properties, with a common human bias towards power despite properties often being more important.
  • Design context is crucial, especially distinguishing between system boundaries where external users can't be broken and internal contexts where mistakes can be fixed later.
  • Programming languages often fail to distinctly embrace both objects and data, leading to design limitations.
  • The 'expression problem' highlights the challenge of extensibility in both representations (objects/data) and operations, with trade-offs in reasoning and organization.
  • Three fundamental design choices for types: Data (extensible functions), Objects (extensible implementations), and Abstract Data Types (no user extensibility but future-proof for authors).
  • Real-world programming requires navigating language limitations to choose the most appropriate design, sometimes compromising ideal solutions for practicality.