You are talking about a problem that is as old as programming. In fact I expect that it started just as soon as the second person learned how to cut code. In a nutshell, it comes down to “How do you interface your code with someone else's code?” There are days when I suspect that all code is just one kind of interface or another— the rest of the time I'm sure of it! The examples you site demonstrate what I mean. You look in vain for their tab A to slip into your slot B, only to find out that all they have are round wooden pegs!

Most times when you hear cubie discussions about interfaces, it is typically about what the user sees when he or she sits down to the application just developed. But that is hardly the only interface we deal with, and the design of every one of them bears directly on the problem you've noticed. We spend vast resources building GUIs but virtually nothing on designing code to be used by other programmers.

Given the way most libraries, modules or what have you develops, it shouldn't come as a surprise that the only code reuser who gets a custom fit, is the one who wrote the code in the first place— pretty much what you would expect. In fact, one of the great ironies in programmer land is that this problem is usually made worse, the better the programmer who wrote it. The best programmers have a style of coding and if that style doesn't match yours, problems ensue. Whatever, most of the time, someone solves a problem (usually a difficult one, but not always) and the next thing you know its available to all comers. Could be free, could cost money, but by whatever means, you see it and shout hooray, 'cause you just know that it will solve the very problem that has been racking your brains for low these many thirty hour days, etc., etc., etc.

And of course that is when you run into this little snag! You need low level functions, they only supply high level. You don't have time to build it, but they have only given you a zillion tiny pieces… Yadda, yadda, yadda, bitch, bitch, moan, moan. So— how do you solve this problem? Well you don't really, you just sort of live with it. At best, you can minimize things, at worst, do what you have to do.

There are some things that help:

Here is one last piece of anecdote, I probably own at least a dozen books on building interfaces, but I've only found one1 on building software tools and libraries!

hsm

1“Building Custom Software Tools and Libraries” by Martin Stitt, John Wiley & Sons, New York, New York. 1993.

Update: ISBN: 0471579149 see http://isbn.nu/0471579149/price


In reply to Re: The temptation to roll your own module than use an existing one.... by hsmyers
in thread The temptation to roll your own module than use an existing one.... by rrwo

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.