DZone
Integration Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Integration Zone > Why You Should Start Using CUPID and Not SOLID To Write Maintainable Software

Why You Should Start Using CUPID and Not SOLID To Write Maintainable Software

While SOLID has always been the standard, it can sometimes be difficult to always apply its principles, and according to Dan North, it may even be outdated.

David Brown user avatar by
David Brown
CORE ·
Jul. 18, 22 · Integration Zone · Interview
Like (4)
Save
Tweet
7.15K Views

Join the DZone community and get the full member experience.

Join For Free

SOLID is an acronym describing the principles of how to write maintainable software. Developed by Robert Martin, the five letters represent five design principles that would help make software designs easy to understand, flexible and scalable for when requirements call for changes.

While it has been the standard for software design and architecture for the last two decades, it can sometimes be difficult to always apply its principles. According to Daniel Terhorst-North, originator of Behaviour-Driven Development and Deliberate Discovery, SOLID may even be outdated.

“When Robert Martin was describing all these principles, he was collecting things. He wasn't just sitting there and making pronouncements. These are things that he'd seen in the wild and he thought they were useful things to bring together. So, there was a good intent behind it. But some things stand the test of time and some things don't, and in test-driven development - we're gonna talk about that later - I came across that over 20 years ago, it was decades old." he says during his interview at Coding Over Cocktails. 

With North being an open critic of SOLID, he has come up with an alternative that calls for writing simple code. He calls it CUPID.

Write Simple Code

CUPID, North says, was conceptualized as he thought about the SOLID principles after a conference. 

“So, for each of the five principles, I go 15 seconds describing it, 15 seconds describing why I don't like it, and 15 seconds saying what I would do instead and thinking, I would have exactly the answer to your question. And as I wrote the talk, I realized that the thing I would do instead was the same thing every time, which is write simple code,” he says.

In his interview below, he explains how he defines “simple code” and why it’s important that all developers understand what you’re trying to build.

“Simple code,” North explains, is not about the code that he alone understands but the code that “fits into someone else’s head.”

“My qualifications for that person's head is that they understand the language, the idiomatic code in that style of language. So, I'm not going to take someone who's never seen Go code before and say, ‘What does this do?’ So, the idea is that someone who's familiar with the language, its ecosystem, its core libraries, its run time, its build chain. And also, some familiarity with the domain that we're working in,” he says.

Being able to write simple code and being able to enjoy coding is what inspired him to come up with CUPID.

“I got to thinking about it and I ended up with properties. I said I wouldn't describe any principles as universal. They're all contextual, but there are properties of code that I think make it joyful to work with, that make coding fun,” North adds.

Learn more about SOLID and CUPID in this episode, and listen to more of the world’s leading experts on architecture, design, and the technologies that facilitate digital transformation on the Coding over Cocktails podcast.

Coding Over Cocktails · What’s wrong with SOLID and Test Driven Development with Daniel Terhorst-North
Software design

Published at DZone with permission of David Brown. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 50 Common Java Errors and How to Avoid Them
  • Using Ingest Pipelines to Enhance Elastic Observability Data
  • Getting Started With Nose in Python
  • Get Started With Kafka and Docker in 20 Minutes

Comments

Integration Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo