<?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/"
	>
	<channel>
		<title>Comments on: Optimization, Templates And The Rest</title>
		<link>http://www.gerd-riesselmann.net/archives/2004/12/optimization-templates-and-the-rest</link>
		<description>Gerd Riesselmann: Notes From the Bog-All Around Objects: C++, .NET, PHP, Design Patterns And More</description>
		<language>en</language>
		<pubDate>Thu, 23 Dec 2004 02:35:17 +0100</pubDate>
		<generator>Drupal TotalFeeds Module</generator>
				<image>
			<title>Comments on: Optimization, Templates And The Rest</title>
			<link>http://www.gerd-riesselmann.net/archives/2004/12/optimization-templates-and-the-rest</link>
			<url>http://www.gerd-riesselmann.net/images/feedbog.png</url>
						<width>130</width>
			<height>80</height>
					</image>
			<item>
		<title>[...] ; inefficiencies they&amp;#8217;ve introduced.</title>
		<link>http://www.gerd-riesselmann.net/node/13%2523comment-9</link>
		<description>[...] ; inefficiencies they&amp;#8217;ve introduced. 	I totally agree. As I already argued regarding &lt;a href=&quot;http://www.gerd-riesselmann.net/archives/2004/12/optimization-templates-and-the-rest/&quot;&gt;C++ optimization&lt;/a&gt;, performance is rather a question of desig [...]</description>
		<content:encoded><![CDATA[<p>[...] ; inefficiencies they&#8217;ve introduced. 	I totally agree. As I already argued regarding <a href="http://www.gerd-riesselmann.net/archives/2004/12/optimization-templates-and-the-rest/">C++ optimization</a>, performance is rather a question of desig [...]</p>
]]></content:encoded>
		<pubDate>Fri, 14 Jan 2005 01:03:50 +0100</pubDate>
		<dc:creator>Gerd Riesselmann: Notes From The Bog - PHP Performance Also</dc:creator>
		<guid isPermaLink="true">http://www.gerd-riesselmann.net/node/13%2523comment-9</guid>
							</item>
		<item>
		<title>Please excuse me for answering that late, but since it is the en</title>
		<link>http://www.gerd-riesselmann.net/node/13%2523comment-12</link>
		<description>Please excuse me for answering that late, but since it is the end of the year, a lot of things are to be finished.

Chris, I actually honor a good rant and yours even taught me two new words (obtuse and prowess), which alone made my day. I also think, that you are right about people using template programming just because it is &lt;em&gt;en vogue&lt;/em&gt;. 

I for example remember a colleague solving a quite simple task with templates and function pointers, leading to nearly unreadable code. Since the template functions had to be specialized for each type, there was no code reuse, and when I refactored it, I came up with five static functions each of which contained about 10 lines of code. Even OO would have been overkill here...

However, policy based design can be effective. An example: Our applications all use a core system that offers several kinds of containers (maps, vectors, lists), for several types (Instances, Links). They all do the same, but they all do it a little bit different. Using templates and PBD, I managed to refactor about 90% of the functionality into one class. About five different implementations of iterators were reduced to one template class (which consists of six really simple functions having an average of five lines of code) and two policy classes (that contain just two lines of code). Which actually is a good thing, since it makes the code more clear and easier to maintain.

Anyhow, extensive use of templates with lot&#039;s of parameters and template template parameters surely turns your code into a monster. And since it isn&#039;t even properly debuggable, it is a monster without a cage. I agree with Len here: Don&#039;t try this at home.</description>
		<content:encoded><![CDATA[<p>Please excuse me for answering that late, but since it is the end of the year, a lot of things are to be finished.</p>
<p>Chris, I actually honor a good rant and yours even taught me two new words (obtuse and prowess), which alone made my day. I also think, that you are right about people using template programming just because it is <em>en vogue</em>. </p>
<p>I for example remember a colleague solving a quite simple task with templates and function pointers, leading to nearly unreadable code. Since the template functions had to be specialized for each type, there was no code reuse, and when I refactored it, I came up with five static functions each of which contained about 10 lines of code. Even OO would have been overkill here...</p>
<p>However, policy based design can be effective. An example: Our applications all use a core system that offers several kinds of containers (maps, vectors, lists), for several types (Instances, Links). They all do the same, but they all do it a little bit different. Using templates and PBD, I managed to refactor about 90% of the functionality into one class. About five different implementations of iterators were reduced to one template class (which consists of six really simple functions having an average of five lines of code) and two policy classes (that contain just two lines of code). Which actually is a good thing, since it makes the code more clear and easier to maintain.</p>
<p>Anyhow, extensive use of templates with lot's of parameters and template template parameters surely turns your code into a monster. And since it isn't even properly debuggable, it is a monster without a cage. I agree with Len here: Don't try this at home.</p>
]]></content:encoded>
		<pubDate>Thu, 23 Dec 2004 02:35:17 +0100</pubDate>
		<dc:creator>Gerd Riesselmann</dc:creator>
		<guid isPermaLink="true">http://www.gerd-riesselmann.net/node/13%2523comment-12</guid>
							</item>
		<item>
		<title>Gerd,

I agree that template meta programming can be useful an</title>
		<link>http://www.gerd-riesselmann.net/node/13%2523comment-11</link>
		<description>Gerd,

I agree that template meta programming can be useful and the stuff in it&#039;s just that Alexandrescu’s book is interesting and thought provoking. BUT it&#039;s an idiom that many people are currently unfamiliar with and it&#039;s also an idiom that many people are keen to play around with, because of this I&#039;d need some solid justification of why it&#039;s being used before I&#039;d want to see it in a normal production system. Right now many uses of meta programming seem to fit into the &quot;doing clever things just to be clever&quot; category and I prefer to see production code that&#039;s as simple as it can be...

By the way I completely agree with you that the design is more important than optimisation. Design it, test it, profile it, optimise it - and you usually wont need the last one but if they design was good then it should be relatively easy to isolate the code that needs optimising and replace it with something faster - and by the time you do that you already have the tests that you wrote for the original version to make sure that your faster version still actually does the right thing.</description>
		<content:encoded><![CDATA[<p>Gerd,</p>
<p>I agree that template meta programming can be useful and the stuff in it's just that Alexandrescu’s book is interesting and thought provoking. BUT it's an idiom that many people are currently unfamiliar with and it's also an idiom that many people are keen to play around with, because of this I'd need some solid justification of why it's being used before I'd want to see it in a normal production system. Right now many uses of meta programming seem to fit into the "doing clever things just to be clever" category and I prefer to see production code that's as simple as it can be...</p>
<p>By the way I completely agree with you that the design is more important than optimisation. Design it, test it, profile it, optimise it - and you usually wont need the last one but if they design was good then it should be relatively easy to isolate the code that needs optimising and replace it with something faster - and by the time you do that you already have the tests that you wrote for the original version to make sure that your faster version still actually does the right thing.</p>
]]></content:encoded>
		<pubDate>Sat, 18 Dec 2004 10:34:14 +0100</pubDate>
		<dc:creator>Len Holgate</dc:creator>
		<guid isPermaLink="true">http://www.gerd-riesselmann.net/node/13%2523comment-11</guid>
							</item>
		<item>
		<title>Gerd, 

I know I quickly threw this off, but this is a topic t</title>
		<link>http://www.gerd-riesselmann.net/node/13%2523comment-10</link>
		<description>Gerd, 

I know I quickly threw this off, but this is a topic that has been on my mind for a year. I wanted to stir up a bit of controversy.  Isn&#039;t that what blogging is all about?  I have a more complete article on this, but I have been having a difficult time getting it through the powers that be, so some of that frustration came out here.  The revision process has sucked the voice out of my article.

I am not a fan of template based PDB.  It does have applications, but I feel they are limited.  You loose the interface specification for the policy.  This is a problem with C++.  It lacks concept checking.  I personally think concept checking and specification is vital, and with out, I almost always avoid PDB with templates.

I&#039;ve heard Alexandrescu speak a couple times on PDB, and he always brings up the performance issue.  But there is no performance issue.  And I argue that it can hurt performance.</description>
		<content:encoded><![CDATA[<p>Gerd, </p>
<p>I know I quickly threw this off, but this is a topic that has been on my mind for a year. I wanted to stir up a bit of controversy.  Isn't that what blogging is all about?  I have a more complete article on this, but I have been having a difficult time getting it through the powers that be, so some of that frustration came out here.  The revision process has sucked the voice out of my article.</p>
<p>I am not a fan of template based PDB.  It does have applications, but I feel they are limited.  You loose the interface specification for the policy.  This is a problem with C++.  It lacks concept checking.  I personally think concept checking and specification is vital, and with out, I almost always avoid PDB with templates.</p>
<p>I've heard Alexandrescu speak a couple times on PDB, and he always brings up the performance issue.  But there is no performance issue.  And I argue that it can hurt performance.</p>
]]></content:encoded>
		<pubDate>Sat, 18 Dec 2004 02:23:48 +0100</pubDate>
		<dc:creator>Christopher Baus</dc:creator>
		<guid isPermaLink="true">http://www.gerd-riesselmann.net/node/13%2523comment-10</guid>
							</item>
		</channel>
	</rss>
	