Once again, we are stuck with an argument mired in reality. If complete standardization were implemented in all things, this discussion would not be necessary because we would all agree, unless of course we all disagreed in an agreed aupon standard manner.

What is involved here is a sense of degree. Turning to the analagy thingie again: If I am makeing a salad for my wife and I, I will shred a carrot by hand, If the salad is for five to twenty people, I will get out the food processor (more standardization and expense), if the salad is to be bagged and sold in stores, I will invest in industrial shredding equipment for large scale operations(still more standardization and more expense). Even though I now own a successful salad bagging corporation, and have a food processor in my cupboard, when my wife and I want a salad, I will still shred the carrot by hand.

Shall we compare this to programming? (even if you don't, I will). If my assigned task is to print Fred Johnson's name, my code may consist of:

print "Fred Johnson\n";

I might even skip strict and warnings (gasp).

If my assigned task is to print any name that can be entered I will use an input routine, a print routine, as well as an edit routine for the user entry (yes yes, strict and warnings at this level - sigh of releif)

If my task is to print the names of all people from an industrial mailing list, I will use the above type of code, but with more standardized options: editing options, error flagging, formatting, extended hooks into each routine and a lot of other standardized techniques.

Why the three(actually more) levels of coding?
Analysis of: requirements, likelyhood of change, and potential longevity of code use. The first example may be a one shot class assignment. This poses very little chance for reuse or modification. The second example might be to echo back the name entered as a part of a kiosk program. Potential change is small or specialized (oops we don't want naughty words to be displayed back - relatively basic addition - no let's not discuss all the potential pitfalls of this statement). The third example has good potential for the requirements to expand, there will be some changes to input or outtput format, and the code may be used in a production environment for a long period of time.

Each and every program has it's own set of constraints - budget, time, paranoia, basic user expectation and so on. All levels of programming can benefit from standardization, but how much of the cost is recoverable from the usefullness of the project.

Looking at it another way, if a game crashes under certain circumstances, I as a user will be a lot more understanding than if my life support system crashes. Why? Becuase if I lose 2 levels in a game it is irritating, if life support crashes, you are messing with my addiction to oxygen.

Still another way:
Look at the door to your house, what kind of lock do you have? (usual answer - lock in the door knob and for extra security there is a deadbolt).
Why not have a retina scanning voice print recognition system with time locks and alarm system (oh and by the way, those glass covered holes in the walls must go), This is MUCH more secure and standardized.

On an on we could go - but as in all things balance must be reached between needs, cost and ability to provide a solution.

Thank you for bringing up a fun point for discussion!
da geek


In reply to Re: Re-use: moderation please. by johndageek
in thread Re-use: moderation please. by BrowserUk

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.