Avoiding Primitive Obsession Using 6 1/2 Programming Languages

Опубликовано: 20 Май 2026
на канале: Jesse Warden
1,275
38

We cover why primitive obsession is a problem, and how to solve it in both dynamic and typed languages. Seeing the same technique implemented in various languages helps give you context, see the tradeoffs more clearly, and see how it is a core problem regardless of language and tool set. It'll help make your code more likely to work and more readable for you and your co-workers.

Code: https://github.com/JesterXL/avoiding-...

Companion Blog Post: https://jessewarden.com/2022/02/avoid...

0:00 Introduction
3:30 Python Dataclasses
15:45 TypeScript Discriminated Unions and Record Types
24:29 ReScript Variants, Records, and Named Type Aliases
30:15 Elm Types, Records, and Named Type Aliases
36:09 GraphQL, JavaScript, and Apollo - Objects and Records
46:07 Dhall Types, Records, and Functions
55:11 Conclusions