Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:14:59+00:00 2026-05-23T12:14:59+00:00

The mantra Keep high cohesion and low coupling (or some variant) is frequently tossed

  • 0

The mantra “Keep high cohesion and low coupling” (or some variant) is frequently tossed around. However, I find that it frequently conflicts with “Don’t repeat yourself.”

For example, I think we can all agree that it’s a bad thing to re-implement std::string or use C-strings, but doesn’t including std::string create another dependency and therefore increase coupling?

For another example, take std::stringstream. It inherits from iostream, which inherits from istream and ostream, which inherit from ios, which inherits from ios_base. Over all these derivations, it inherits a lot of functionality – enough to make re-implementing by hand a very bad idea. It also pulls the <ios> and <istream> headers even though only <sstream> was included, thereby increasing coupling.

How can one keep coupling low without reinventing the wheel for each module?

EDIT: If the two concepts cannot coexist, which one should be favored?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:15:00+00:00Added an answer on May 23, 2026 at 12:15 pm

    Please go through http://www.artima.com/intv/dry.html on DRY,
    particularly “Most people take DRY to mean you shouldn’t duplicate code. That’s not its intention. The idea behind DRY is far grander than that”.

    Adding to this, in the example you discussed , std::string and your system are not tightly coupled as you are not relying/using any internal info of std::string. Any (internal) changes to std::string will not effect your system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written C# and the mantra coming from on high seems to be never
$personInfo['mantra'] is the piece that I'm working with. I want everything to be capitalized,
I understand the mantra of don't roll your own when it comes to site
When you learn HTML and so forth nowadays, the mantra is always Clean code
I'm relatively new to the Maven mantra, but I'm trying to build a command-line
Code In question I have heard (and regurgitated) the C++ exception mantra on both
There's a real art to designing a website that works for everyone, and Progressive
I am working on an App that will have a bunch of pictures and
I am currently working on rewriting an application to use Data Mappers that completely
Surprisingly I was only able to find one previous question on SO about this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.