<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>浮山狼de博客 &#187; 重复</title>
	<atom:link href="https://www.fushanlang.com/tag/repeats/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fushanlang.com</link>
	<description>next station - 下一站，活在当下，且行且思</description>
	<lastBuildDate>Sat, 29 Nov 2014 15:14:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.5</generator>
	<item>
		<title>Don&#8217;t be afraid to repeat yourself!</title>
		<link>https://www.fushanlang.com/don-t-be-afraid-to-repeat-yourself-590/</link>
		<comments>https://www.fushanlang.com/don-t-be-afraid-to-repeat-yourself-590/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 06:36:13 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[感悟]]></category>
		<category><![CDATA[repeat]]></category>
		<category><![CDATA[重复]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=590</guid>
		<description><![CDATA[Don&#8217;t be afraid to repeat yourself! Repeating everything you say is an essential skill if you want to get anywhere in life. It could save you a lot of trouble. Like say you discovered the cure for cancer, and you only had one friend/acquaintance because everyone else you tried to talk to ran away because you had a giant <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/don-t-be-afraid-to-repeat-yourself-590/">Don&#8217;t be afraid to repeat yourself!</a></span>]]></description>
				<content:encoded><![CDATA[<h4 id="subjcns!E0F515ABB4515620!189">Don&#8217;t be afraid to repeat yourself!</h4>
<div id="msgcns!E0F515ABB4515620!189">
<div><span style="color: #000000;">Repeating everything you say is an essential skill if you want to get anywhere in life. It could save you a lot of trouble. Like say you discovered the cure for cancer, and you only had one friend/acquaintance because everyone else you tried to talk to ran away because you had a giant mole or something, and you told that person and they acted all excited and happy for you so you thought you&#8217;d gotten the message across but you never found out that what they really heard was &#8220;I want to become a dancer!&#8221;. This hypothetical situation would only work if you speak with an American accent (or you pronounce cancer as KAHN-ser), but I&#8217;m sure there are millions of other examples out there. Perhaps you found out the meaning of life and you told your person and they thought you said &#8220;I&#8217;ve been cleaning my knife,&#8221; then they&#8217;d probably run away from you just like everyone else and you&#8217;d be left with no one and you&#8217;d die alone, miserable and ugly. And why? Because you didn&#8217;t repeat yourself.<span id="more-590"></span></span></div>
<div> </div>
<div><span style="color: #000000;">The Catcher in the Rye is considered one of the greatest novels out there. It&#8217;s narrated by this guy, Holden. He&#8217;s very repetitive. All he ever does is repeat himself. The way he talks is supposedly what makes his character believable. I bet if he just said everything once, the novel would be half as thick as it is and a million times less successful. J.D. Salinger must have made a fortune by saying stuff he&#8217;d already said over and over again. If I ever write a book, I&#8217;ll be sure to have whole chapters repeated. Everyone will love me for it.</span></div>
<div> </div>
<div><span style="color: #000000;">I had read this novel a couple of years ago, but we studied it at school this year as well. This meant I had to read it again, but of course that wasn&#8217;t a problem. Reading it again refreshed my memory of it and reinforced ideas I&#8217;d gotten from the first reading, just like repeating yourself would. This was extremely helpful for writing essays about it. With the wondrous NCEA system, guess what we have to do to get Excellence? We have to keep relating our points to the words of the question. That is, we repeat the words in the question as much as we can so that the marker knows we know what we&#8217;re meant to be talking about. So you see, repeating yourself gains you respect from people with really impressive jobs, such as teachers.</span></div>
<div> </div>
<div><span style="color: #000000;">Now, consider music. I love music. <em>Everyone</em> loves music. That&#8217;s what it&#8217;s there for. To love. I take music as a subject, so I&#8217;m well aware that a well structured piece has a whole heap of repetition in it. There&#8217;s a sign that tells you to repeat things. You ask someone with the most basic musical knowledge what those two lines with the little dots in front of them means and they&#8217;ll say &#8220;It&#8217;s a repeat. That means you play it again.&#8221; That&#8217;s right. Play it again. Id est, repeat the music you&#8217;ve already heard. Why? Because whoever wrote it thinks it would be nice to hear it again. Not only do you use repeat signs to repeat things in music, there is also the concept of a chorus in a song, or just using the same melody or words or rhythm or whatever again when it sounds good. I bet there isn&#8217;t a song out there without some form of repetition in it. And, like I said, everyone loves music, so it would pay to learn something from it. Perhaps someomeone would love you too if you had repeats.</span></div>
<div> </div>
<div><span style="color: #000000;">I suggest you go back and read what I wrote again, so I don&#8217;t have to repeat myself.</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/don-t-be-afraid-to-repeat-yourself-590/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Repeat Yourself</title>
		<link>https://www.fushanlang.com/don-t-repeat-yourself-587/</link>
		<comments>https://www.fushanlang.com/don-t-repeat-yourself-587/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 06:34:35 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[感悟]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[repeat]]></category>
		<category><![CDATA[重复]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=587</guid>
		<description><![CDATA[<p>Don&#8217;t Repeat Yourself</p> <p>Context:</p> <p>Duplication (inadvertent or purposeful duplication) can lead to maintenance nightmares, poor factoring, and logical contradictions.</p> <p>Duplication, and the strong possibility of eventual contradiction, can arise anywhere: in architecture, requirements, code, or documentation. The effects can range from mis-implemented code and developer confusion to complete system failure.</p> <p>The Mars Climate Orbiter <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/don-t-repeat-yourself-587/">Don&#8217;t Repeat Yourself</a></span>]]></description>
				<content:encoded><![CDATA[<p><strong>Don&#8217;t Repeat Yourself</strong></p>
<p>Context:</p>
<p>Duplication (inadvertent or purposeful duplication) can lead to maintenance nightmares, poor factoring, and logical contradictions.</p>
<p>Duplication, and the strong possibility of eventual contradiction, can arise anywhere: in architecture, requirements, code, or documentation. The effects can range from mis-implemented code and developer confusion to complete system failure.<span id="more-587"></span></p>
<p>The Mars Climate Orbiter was lost due to a semantic contradiction: part of the system was working in Imperial units, another in Metric. There was a duplication of knowledge (implicit units), and the duplicates were out of step.</p>
<p>One could argue that most of the difficulty in Y2K remediation is due to the lack of a single date abstraction within any given system; the knowledge of dates and date-handling is widely spread.</p>
<p>The Problem:</p>
<p>But what exactly counts as duplication? CloneAndModifyProgramming is generally cited as the chief culprit (see OnceAndOnlyOnce, etc.), but there is more to it than that. Whether in code, architecture, requirements documents, or user documentation, duplication of knowledge &#8211; not just text &#8211; is the real culprit.</p>
<p>Therefore:</p>
<p>The DRY (Don&#8217;t Repeat Yourself) Principle states:</p>
<p>Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.</p>
<p>It&#8217;s okay to have mechanical, textual duplication (the equivalent of caching values: a repeatable, automatic derivation of one source file from some meta-level description), as long as the authoritative source is well known.</p>
<p>For example, in a mixed-language CORBA environment you may choose to treat the IDL definitions as authoritative. These definitions will be used to automatically generate source code files which duplicate the knowledge in the IDL. But that&#8217;s okay: the IDL form of the knowledge meets the requirements of our definition.</p>
<p>Where different levels of abstraction are involved, a consistent conflict-resolution scheme must be used. This could be as simple as identifying one level as authoritative in all cases, or always deferring to the high level, or whatever, as long as it is consistently applied.</p>
<p>For example, in C++ the interface and implementation for a class are typically specified in separate files, duplicating knowledge. You may consider the header file to be authoritative for the contract of the class as viewed by its clients, and the source code to be authoritative regarding issues of implementation which are hidden by the implementation.</p>
<p>Notes:</p>
<p>This principle is similar to OnceAndOnlyOnce, but with a different objective. With OnceAndOnlyOnce, you are encouraged to refactor to eliminate duplicated code and functionality. With DRY, you try to identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).</p>
<p>The principle also assumes that your projects have a high degree of automation, allowing the generation of the derivative knowledge artifacts whenever required.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/don-t-repeat-yourself-587/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.126 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2025-12-17 17:31:40 -->
