<?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: Building A Better C++ String Class?</title>
		<link>http://www.gerd-riesselmann.net/archives/2005/01/building-a-better-c-string-class</link>
		<description>Gerd Riesselmann: Notes From the Bog-All Around Objects: C++, .NET, PHP, Design Patterns And More</description>
		<language>en</language>
		<pubDate>Sun, 27 Feb 2005 23:52:59 +0100</pubDate>
		<generator>Drupal TotalFeeds Module</generator>
				<image>
			<title>Comments on: Building A Better C++ String Class?</title>
			<link>http://www.gerd-riesselmann.net/archives/2005/01/building-a-better-c-string-class</link>
			<url>http://www.gerd-riesselmann.net/images/feedbog.png</url>
						<width>130</width>
			<height>80</height>
					</image>
			<item>
		<title>I think writing your own string class must be a project everyone</title>
		<link>http://www.gerd-riesselmann.net/node/31%2523comment-17</link>
		<description>I think writing your own string class must be a project everyone has done.  In fact I&#039;ve written my own called &quot;The Better String Library&quot; which is relevant to your points above:

1. &quot;The Better String Library&quot; *outperforms* standard C string library functions, std::string and MFC&#039;s CString class on a variety of the most common string manipulation tasks (often by massive margins).  This has been confirmed by benchmarking on multiple CPUs, operating systems and compilers.

2. Avoiding unnecessary heap allocations is a misdirected effort. (&quot;copy-on-write&quot; is hard to make thread safe, and certainly cannot be done without impacting performance).  It only helps in the most marginal cases while adding to the overhead of mainline code.

3. Inlining is usually only necessary and/or beneficial (performance-wise) for trivial accessor functions, while adding to the footprint of your code (since code paths are redundantly generated.)  The best answer is just to use the standard &quot;inline&quot; declaration on methods where it is appropriate.

For the evidence I invite you to look at all the data here:

    http://bstring.sf.net/features.html

You can even download the benchmarks for yourself from the examples.

But of course, this all ignores the far more important question about string manipulation in todays security and cost conscious programming environment:

A. How safe is the string manipulation with respect to buffer overflows?
B. How easy is the library to use and understand?
C. How portable is the library?
D. Is the library well documented?
E. Is the library well tested?
F. Is the library being actively maintained?

You can check the Better String library against any of these criteria, and you will find it hard to beat with *any* alternative.</description>
		<content:encoded><![CDATA[<p>I think writing your own string class must be a project everyone has done.  In fact I've written my own called "The Better String Library" which is relevant to your points above:</p>
<p>1. "The Better String Library" *outperforms* standard C string library functions, std::string and MFC's CString class on a variety of the most common string manipulation tasks (often by massive margins).  This has been confirmed by benchmarking on multiple CPUs, operating systems and compilers.</p>
<p>2. Avoiding unnecessary heap allocations is a misdirected effort. ("copy-on-write" is hard to make thread safe, and certainly cannot be done without impacting performance).  It only helps in the most marginal cases while adding to the overhead of mainline code.</p>
<p>3. Inlining is usually only necessary and/or beneficial (performance-wise) for trivial accessor functions, while adding to the footprint of your code (since code paths are redundantly generated.)  The best answer is just to use the standard "inline" declaration on methods where it is appropriate.</p>
<p>For the evidence I invite you to look at all the data here:</p>
<p>    <a href="http://bstring.sf.net/features.html" title="http://bstring.sf.net/features.html">http://bstring.sf.net/features.html</a></p>
<p>You can even download the benchmarks for yourself from the examples.</p>
<p>But of course, this all ignores the far more important question about string manipulation in todays security and cost conscious programming environment:</p>
<p>A. How safe is the string manipulation with respect to buffer overflows?<br />
B. How easy is the library to use and understand?<br />
C. How portable is the library?<br />
D. Is the library well documented?<br />
E. Is the library well tested?<br />
F. Is the library being actively maintained?</p>
<p>You can check the Better String library against any of these criteria, and you will find it hard to beat with *any* alternative.</p>
]]></content:encoded>
		<pubDate>Sun, 27 Feb 2005 23:52:59 +0100</pubDate>
		<dc:creator>Paul Hsieh</dc:creator>
		<guid isPermaLink="true">http://www.gerd-riesselmann.net/node/31%2523comment-17</guid>
							</item>
		<item>
		<title>In fact, Herb sutter thinks (i</title>
		<link>http://www.gerd-riesselmann.net/node/31%2523comment-16</link>
		<description>In fact, Herb sutter thinks (in &lt;a href=&quot;http://www.gotw.ca/gotw/084.htm&quot;&gt;http://www.gotw.ca/gotw/084.htm&lt;/a&gt;) it has far too many members...</description>
		<content:encoded><![CDATA[<p>In fact, Herb sutter thinks (in <a href="http://www.gotw.ca/gotw/084.htm">http://www.gotw.ca/gotw/084.htm</a>) it has far too many members...</p>
]]></content:encoded>
		<pubDate>Mon, 31 Jan 2005 10:19:31 +0100</pubDate>
		<dc:creator>splintor</dc:creator>
		<guid isPermaLink="true">http://www.gerd-riesselmann.net/node/31%2523comment-16</guid>
							</item>
		<item>
		<title>Indeed the string class is missing quite a lot.</title>
		<link>http://www.gerd-riesselmann.net/node/31%2523comment-15</link>
		<description>Indeed the string class is missing quite a lot. Always wondered why, actually. Everyone I know - including me - is customizing it by adding convenient functions like replace(const string&amp; what, const string&amp; with), trim(), toLower() etc.</description>
		<content:encoded><![CDATA[<p>Indeed the string class is missing quite a lot. Always wondered why, actually. Everyone I know - including me - is customizing it by adding convenient functions like replace(const string&amp; what, const string&amp; with), trim(), toLower() etc.</p>
]]></content:encoded>
		<pubDate>Tue, 18 Jan 2005 20:30:08 +0100</pubDate>
		<dc:creator>Gerd Riesselmann</dc:creator>
		<guid isPermaLink="true">http://www.gerd-riesselmann.net/node/31%2523comment-15</guid>
							</item>
		<item>
		<title>I agree.  Definitely NIH Syndrome.</title>
		<link>http://www.gerd-riesselmann.net/node/31%2523comment-14</link>
		<description>I agree.  Definitely NIH Syndrome.  I pointed this out because this is example of how low level optimizations can back fire, not because I think it is a good idea to reimplement the string class.  Although most people seem to agree that the standard string class is missing a lot of functionality.</description>
		<content:encoded><![CDATA[<p>I agree.  Definitely NIH Syndrome.  I pointed this out because this is example of how low level optimizations can back fire, not because I think it is a good idea to reimplement the string class.  Although most people seem to agree that the standard string class is missing a lot of functionality.</p>
]]></content:encoded>
		<pubDate>Tue, 18 Jan 2005 18:36:03 +0100</pubDate>
		<dc:creator>Christopher Baus</dc:creator>
		<guid isPermaLink="true">http://www.gerd-riesselmann.net/node/31%2523comment-14</guid>
							</item>
		</channel>
	</rss>
	