I have been reading with great interest an exchange between tilly on one side and apotheon and adrianh on the other, on the subject of loosely coupled (aka modular) vs. tightly coupled systems. I thought this was too great a topic, and the arguments presented too well made, for it to be buried in an unrelated thread, so I thought I would turn my $0.02 into a root node, to call attention to this topic and to these comment nodes.

My experience agrees with both sides of this argument. I do scientific programming. The programs I and my colleagues write are intended to perform some analysis (number crunching, or simulations, etc.), and ultimately spit out answers. We are constantly pushing the performance envelope, because the person who gets the paper in Science or Nature is the one who was able to push that envelope the hardest to tackle problems that the rest of the field has not being able to tackle.

But scientific programming often also demands modularity and lose coupling, because every set of results prompts new questions that often make the programs that produced the answers obsolete. So we are in a constant tension between making our programs fast enough (which invariably means tight coupling) and modifiable enough (which means loose coupling).

Hence, we end up doing a lot of hybrid Perl+XS+C programming: Perl wrappers for rapid development and user interfaces, and C libraries for the time-critical core routines. And even the Perl stuff is not as modular is it could be, because it would be too slow. I have re-invented many wheels in pure Perl because the beautifully modular, exquisitely object-oriented stuff I could download from CPAN was simply too slow.

I close with the words of the inimitable Linda Richman: discuss.

the lowliest monk

Well, I guess that's two lies right there: it's only one word, and Linda Richman is famous only because she is eminently imitable... Oh, well. Too tired now to think of a more truthful ending.

In reply to Loose vs. Tight Coupling by tlm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.