<?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"
	>
<channel>
	<title>Comments on: Six language-independent ways to write better code</title>
	<atom:link href="http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/</link>
	<description></description>
	<pubDate>Thu, 24 Jul 2008 16:21:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: language independent ways to write better code &#171; Try your best, man</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-113</link>
		<dc:creator>language independent ways to write better code &#171; Try your best, man</dc:creator>
		<pubDate>Wed, 18 Jul 2007 14:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-113</guid>
		<description>[...] 18th, 2007 by hanxiaogang    On his site learncpp.com, alex gives a post on six ways to write better [...]</description>
		<content:encoded><![CDATA[<p>[...] 18th, 2007 by hanxiaogang    On his site learncpp.com, alex gives a post on six ways to write better [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gwyn Fisher, CTO Klocwork</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-73</link>
		<dc:creator>Gwyn Fisher, CTO Klocwork</dc:creator>
		<pubDate>Tue, 03 Jul 2007 14:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-73</guid>
		<description>Great summary. Most, if not all, of the issues that you bring up are handled by prevalent static analysis tools (disclaimer: such as the one my company sells). Static analysis in this context can be thought of as taking off where the compiler stops, i.e. evaluating the function of the code, not just its syntactical (and surface semantic) correctness. I encourage you and your readers to check out the various tools available in the space -- search wikipedia for static analysis and you'll find links to the most popular ones (of course, I'd love it if you checked out Klocwork first! ;p).

In summary, C++ continues to be a complex language to master, but there are tools out there that can act as the "guy looking over your shoulder" pointing out what you're missing, or when you're applying a potentially damaging semantic or side-effect.</description>
		<content:encoded><![CDATA[<p>Great summary. Most, if not all, of the issues that you bring up are handled by prevalent static analysis tools (disclaimer: such as the one my company sells). Static analysis in this context can be thought of as taking off where the compiler stops, i.e. evaluating the function of the code, not just its syntactical (and surface semantic) correctness. I encourage you and your readers to check out the various tools available in the space &#8212; search wikipedia for static analysis and you&#8217;ll find links to the most popular ones (of course, I&#8217;d love it if you checked out Klocwork first! ;p).</p>
<p>In summary, C++ continues to be a complex language to master, but there are tools out there that can act as the &#8220;guy looking over your shoulder&#8221; pointing out what you&#8217;re missing, or when you&#8217;re applying a potentially damaging semantic or side-effect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - A tutorial and blog on C++, object-oriented design, and related topics &#187; Eight C++ programming mistakes the compiler won't catch</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-71</link>
		<dc:creator>Learn C++ - A tutorial and blog on C++, object-oriented design, and related topics &#187; Eight C++ programming mistakes the compiler won't catch</dc:creator>
		<pubDate>Mon, 02 Jul 2007 17:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-71</guid>
		<description>[...] Six language-independent ways to write better code [...]</description>
		<content:encoded><![CDATA[<p>[...] Six language-independent ways to write better code [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 6 language-independent ways to write better code : n ways to</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-67</link>
		<dc:creator>6 language-independent ways to write better code : n ways to</dc:creator>
		<pubDate>Fri, 29 Jun 2007 09:15:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-67</guid>
		<description>[...] via [...]</description>
		<content:encoded><![CDATA[<p>[...] via [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-63</link>
		<dc:creator>C</dc:creator>
		<pubDate>Thu, 28 Jun 2007 12:23:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-63</guid>
		<description>I agree with most of your point 1. Especially "code generically" is a sound advice. The C++ templates offer superb support for generic coding. Even though the syntax is obscure (and often compiler errors too), templates can really help in writing generic, reusable code. They even help *thinking* generically.

Still, if you have a specific, one-off problem, making the solution a reusable library is a waste of time, or maybe even a source for a maintenance nightmare. Writing a good reusable library is difficult, and often it takes a couple of rewrites and revisions, plus more understanding of the problem domain than might be initially available, to make it truly usable.

Now, if your fingers start itching to make a Copy/Paste of the original one-off, it obviously isn't a one-off any more, but a candidate for a reusable library. At that time it might be best to start from scratch and design the library properly, then maybe replace the original code. Not the other way round.

The subnote on item #2 is funny. I'd say iii (or one of the classic alternatives i, j, k and m) is a perfect name for a loop variable. It is sensible to give better names to other variables, of course.</description>
		<content:encoded><![CDATA[<p>I agree with most of your point 1. Especially &#8220;code generically&#8221; is a sound advice. The C++ templates offer superb support for generic coding. Even though the syntax is obscure (and often compiler errors too), templates can really help in writing generic, reusable code. They even help *thinking* generically.</p>
<p>Still, if you have a specific, one-off problem, making the solution a reusable library is a waste of time, or maybe even a source for a maintenance nightmare. Writing a good reusable library is difficult, and often it takes a couple of rewrites and revisions, plus more understanding of the problem domain than might be initially available, to make it truly usable.</p>
<p>Now, if your fingers start itching to make a Copy/Paste of the original one-off, it obviously isn&#8217;t a one-off any more, but a candidate for a reusable library. At that time it might be best to start from scratch and design the library properly, then maybe replace the original code. Not the other way round.</p>
<p>The subnote on item #2 is funny. I&#8217;d say iii (or one of the classic alternatives i, j, k and m) is a perfect name for a loop variable. It is sensible to give better names to other variables, of course.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Razorwit</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-60</link>
		<dc:creator>Razorwit</dc:creator>
		<pubDate>Wed, 27 Jun 2007 19:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-60</guid>
		<description>[...] Here&#8217;s the article: Six Language-independent Ways to Write Better Code [...]</description>
		<content:encoded><![CDATA[<p>[...] Here&#8217;s the article: Six Language-independent Ways to Write Better Code [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 6 ???????? ?????? ????? ?????? ???&#8230; &#171; ???? ?????? ???????</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-59</link>
		<dc:creator>6 ???????? ?????? ????? ?????? ???&#8230; &#171; ???? ?????? ???????</dc:creator>
		<pubDate>Wed, 27 Jun 2007 13:04:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-59</guid>
		<description>[...] 6 ???????? ?????? ????? ??????&#160;???&#8230; June 27th, 2007   ???????? - http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/ [...]</description>
		<content:encoded><![CDATA[<p>[...] 6 ???????? ?????? ????? ??????&nbsp;???&#8230; June 27th, 2007   ???????? - <a href="http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/" rel="nofollow">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mnemetica &#187; Blog Archive &#187; links for 2007-06-26</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-57</link>
		<dc:creator>mnemetica &#187; Blog Archive &#187; links for 2007-06-26</dc:creator>
		<pubDate>Tue, 26 Jun 2007 19:17:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-57</guid>
		<description>[...] Learn C++ - A tutorial and blog on C++, object-oriented design, and related topics Â» Six language-i... (tags: coding design development documentation optimization process programming software tips toread) [...]</description>
		<content:encoded><![CDATA[<p>[...] Learn C++ - A tutorial and blog on C++, object-oriented design, and related topics Â» Six language-i&#8230; (tags: coding design development documentation optimization process programming software tips toread) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-56</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Tue, 26 Jun 2007 18:45:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-56</guid>
		<description>Nice article.
But there is a counter-argument to your first point known as YAGNI: http://c2.com/xp/YouArentGonnaNeedIt.html
In my experience, a balance of the two approaches makes sense. For example, your fifth point somewhat affirms the YAGNI approach. 
Also low-effort extensibility can be had by replacing explicit loops with algorithms (STL,etc); b/c container details get encapsulated. Even better, algos relegate magic numbers to once place, the iterator.</description>
		<content:encoded><![CDATA[<p>Nice article.<br />
But there is a counter-argument to your first point known as YAGNI: <a href="http://c2.com/xp/YouArentGonnaNeedIt.html" rel="nofollow">http://c2.com/xp/YouArentGonnaNeedIt.html</a><br />
In my experience, a balance of the two approaches makes sense. For example, your fifth point somewhat affirms the YAGNI approach.<br />
Also low-effort extensibility can be had by replacing explicit loops with algorithms (STL,etc); b/c container details get encapsulated. Even better, algos relegate magic numbers to once place, the iterator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Schmidt</title>
		<link>http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-55</link>
		<dc:creator>Bob Schmidt</dc:creator>
		<pubDate>Tue, 26 Jun 2007 18:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/general-programming/six-language-independent-ways-to-write-better-code/#comment-55</guid>
		<description>Extensibility
CASE statements often recognize the nature of the business process
CASE / EVALUATE PARM-A ALSO PARM-B ... ALSO PARM-Z
  WHEN COMBINATION A1-B2-Z9
    THEN DO ....
  WHEN COMBINATION A2-B2-Z9
    THEN DO ....
  ELSE   DO ....
END

Start with known parms.  Use them to find the unknown value of other parms.  With each new combination of parm value possibilities, just add a new WHEN... THEN ...   Maybe create stubbed out options in advance and have fewer objects to change later.

Re-inventing the Wheel
Oracle, MS, IBM compete for the best DBMS.  The DBMS is just a set of re-usable code.  There is no way we can write better reusable code than that already written.  SQL is just a set of parms sent to the re-usable objects in the DBMS.  Re-inventing what is already in the DBMS seems to be the biggest waste of time and money.  But it's a great way to create billable hours and full employment on a project.</description>
		<content:encoded><![CDATA[<p>Extensibility<br />
CASE statements often recognize the nature of the business process<br />
CASE / EVALUATE PARM-A ALSO PARM-B &#8230; ALSO PARM-Z<br />
  WHEN COMBINATION A1-B2-Z9<br />
    THEN DO &#8230;.<br />
  WHEN COMBINATION A2-B2-Z9<br />
    THEN DO &#8230;.<br />
  ELSE   DO &#8230;.<br />
END</p>
<p>Start with known parms.  Use them to find the unknown value of other parms.  With each new combination of parm value possibilities, just add a new WHEN&#8230; THEN &#8230;   Maybe create stubbed out options in advance and have fewer objects to change later.</p>
<p>Re-inventing the Wheel<br />
Oracle, MS, IBM compete for the best DBMS.  The DBMS is just a set of re-usable code.  There is no way we can write better reusable code than that already written.  SQL is just a set of parms sent to the re-usable objects in the DBMS.  Re-inventing what is already in the DBMS seems to be the biggest waste of time and money.  But it&#8217;s a great way to create billable hours and full employment on a project.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
