<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: To DRY or not to DRY?	</title>
	<atom:link href="https://www.fluentcpp.com/2018/11/13/to-dry-or-not-to-dry/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/11/13/to-dry-or-not-to-dry/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Wed, 28 Nov 2018 12:55:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.4</generator>
	<item>
		<title>
		By: Colin Pitrat		</title>
		<link>https://www.fluentcpp.com/2018/11/13/to-dry-or-not-to-dry/#comment-1505</link>

		<dc:creator><![CDATA[Colin Pitrat]]></dc:creator>
		<pubDate>Wed, 28 Nov 2018 12:55:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4421#comment-1505</guid>

					<description><![CDATA[I don&#039;t really agree with the second example, this is just a design bug. The problem is using the wrong data, not reusing the code.]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t really agree with the second example, this is just a design bug. The problem is using the wrong data, not reusing the code.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: TH		</title>
		<link>https://www.fluentcpp.com/2018/11/13/to-dry-or-not-to-dry/#comment-1477</link>

		<dc:creator><![CDATA[TH]]></dc:creator>
		<pubDate>Mon, 19 Nov 2018 19:26:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4421#comment-1477</guid>

					<description><![CDATA[I agree that there may be situations where DRY may not be followed 100%, just on the basis that no rule is true in 100% of cases. I do not agree with either of the two examples, though.


In the first example, the developer misses the chance for abstraction. The two functions here are apparently exactly the same, so in the words of &#039;the pragmatic programmer&#039; they do have the same information. If they evolve in different directions, though, not all information is the same. The challenge is to find the information that is actually the same, and what information is different, and write smaller functions that take care of the similar bits, or abstract algorithms that may be specialized using some sort of strategy pattern.


In the second example, the issue is bad design, as jft says. Really, the design seems to try to avoid repetition of data, not of code. Persistence and lifetime are issues of objects, not of classes. There is no need to create separate classes for the two instances, it is necessary to create separate objects for the invoice system, that encapsulate the information about the invoice.]]></description>
			<content:encoded><![CDATA[<p>I agree that there may be situations where DRY may not be followed 100%, just on the basis that no rule is true in 100% of cases. I do not agree with either of the two examples, though.</p>
<p>In the first example, the developer misses the chance for abstraction. The two functions here are apparently exactly the same, so in the words of &#8216;the pragmatic programmer&#8217; they do have the same information. If they evolve in different directions, though, not all information is the same. The challenge is to find the information that is actually the same, and what information is different, and write smaller functions that take care of the similar bits, or abstract algorithms that may be specialized using some sort of strategy pattern.</p>
<p>In the second example, the issue is bad design, as jft says. Really, the design seems to try to avoid repetition of data, not of code. Persistence and lifetime are issues of objects, not of classes. There is no need to create separate classes for the two instances, it is necessary to create separate objects for the invoice system, that encapsulate the information about the invoice.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jft		</title>
		<link>https://www.fluentcpp.com/2018/11/13/to-dry-or-not-to-dry/#comment-1465</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Tue, 13 Nov 2018 16:46:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4421#comment-1465</guid>

					<description><![CDATA[IMO the issue with the web site is simply down to bad design - not DRY code. Once an invoice is produced, ALL of its details are immutable - including date, company info, layout etc. Any re-print/download of an invoice must be as it was originally - even if the company&#039;s logo has changed or they have moved address etc. You hold the original invoice as a pdf/html (or something similar). Even if you hold separately the exact data that was used to generate the original invoice, the layout etc may have changed from when it was first produced. In the UK they need to be kept for at least 5 years (6 for VAT and 10 for VAT MOSS).]]></description>
			<content:encoded><![CDATA[<p>IMO the issue with the web site is simply down to bad design &#8211; not DRY code. Once an invoice is produced, ALL of its details are immutable &#8211; including date, company info, layout etc. Any re-print/download of an invoice must be as it was originally &#8211; even if the company&#8217;s logo has changed or they have moved address etc. You hold the original invoice as a pdf/html (or something similar). Even if you hold separately the exact data that was used to generate the original invoice, the layout etc may have changed from when it was first produced. In the UK they need to be kept for at least 5 years (6 for VAT and 10 for VAT MOSS).</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
