Exploring Joy-Driven Coding and the 'CUPID' Method by Daniel Terhorst-North
Daniel Terhorst-North's visionary CUPID framework challenges conventional SOLID principles by prioritizing properties over principles. Explore how CUPID reshapes our perspective on software design, redefining success metrics and delve into a paradigm-altering shift that merges joy and functionality at the core of code creation.
Read further
The SOLID principles were developed by Robert C. Martin aka Uncle Bob in 2000 although the acronym was coined later by Michael Feathers. While it is still relevant, a new perspective known as CUPID emerged, ushering in a paradigm shift that prompts a deep exploration of foundational concepts. CUPID, conceived by Daniel Terhorst-North, introduces a compelling approach with properties or characteristics that make software and coding a joy to work with. According to Daniel, the more your code has the CUPID qualities, the more joyful it is to work with. However, everything is a tradeoff so you should always consider your context.
The First Step – Infusing Joy into Code
The uniqueness of Daniel's approach with CUPID becomes evident right from its inception, as it champions the elevation of code to a state of joy. In a nod to the wisdom of Martin Fowler, "Good programmers write code that humans can understand," Daniel amplifies this concept, advocating the creation of code that not only humans can comprehend but also delight in engaging with.
CUPID's selection of properties, which will be examined in due course, is underpinned by their capacity to gauge the level of joy that a codebase offers in terms of usability and engagement. Another key characteristic to strive for is habitability. Computing pioneer Richard P. Gabriel described the idea of code in the following words: “Habitability is the characteristic of source code that enables [people] to understand its construction and intentions and to change it comfortably and confidently. “Habitability makes a place liveable, like home.”
Properties over Principles
A pivotal juncture in Daniel's CUPID philosophy is the abandonment of conventional design principles in favor of properties that characterize the design of a codebase. This necessitates a shift in perspective, transitioning from an understanding of design based on principles to one predicated on properties. Daniel defines properties as attributes or qualities inherent to code, in contrast to prescriptive rules. Properties manifest as benchmarks or centers towards which code should gravitate, allowing for a quantifiable proximity to these centers and a clear trajectory of progress. These properties can function as lenses through which code is evaluated, with developers determining which properties warrant their focus at any given juncture.
Crafting Useful Properties
For the task of identifying properties that engender joyful software, the inquiry turns to what constitutes an effective property. Daniel's exploration extends to delineating the characteristics of properties themselves. The CUPID properties embody specific attributes:
Practicality: Ease of articulation, evaluation and adoption
Human-centric: Comprehensible from the viewpoint of developers, emphasizing human understanding over mere code interpretation.
Layered Guidance: Offering entry points for novices alongside nuanced insights for experienced practitioners.
Introducing the CUPID Properties
Central to Daniel's vision are the five distinctive CUPID properties, aptly encapsulated in an acronym that parallels the SOLID principles, albeit with unique connotations. Each property is accompanied by a brief elaboration, underscoring its pertinence:
Composable: Harmonizing cohesively with other components, featuring a succinct scope, intention transparency, and minimal external dependencies—a notion that significantly influences infrastructure code design considerations.
Unix Philosophy: Specializing in a singular task, adhering to a straightforward, consistent model, and distinguishing between single-purpose functionality and a holistic sense of responsibility.
Predictable: Demonstrating anticipated behavior, characterized by robustness, deterministic outcomes, and observability—an aspect that ignites contemplation on embedding observability within infrastructure code.
Idiomatic: Exuding a natural feel, alleviating cognitive load, embracing language and local idioms—an avenue that necessitates exploration on guiding design without delving into prescriptive mandates.
Domain-based: Aligning the solution domain with the problem domain through linguistic and structural congruence, encompassing domain-oriented language, structural alignment, and judicious domain boundaries. This facet prompts a critical reevaluation of prevalent norms in infrastructure code.
The CUPID approach initiates a transformative discourse in software design, challenging conventional norms by spotlighting properties over principles. Its focus on engendering joy in code usage positions it at the forefront of contemporary design philosophies. As the journey into CUPID unfolds, the forthcoming exploration of its application to infrastructure code design holds the promise of reshaping how we conceptualize and craft software systems.