<?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/"
		>
<channel>
	<title>Comments on: The Art of Writing Code</title>
	<atom:link href="http://www.dannyfoo.com/blog/website-development/the-art-of-writing-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dannyfoo.com/blog/website-development/the-art-of-writing-code/</link>
	<description>Malaysia website design blog</description>
	<lastBuildDate>Sat, 04 Feb 2012 04:00:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Hawk</title>
		<link>http://www.dannyfoo.com/blog/website-development/the-art-of-writing-code/comment-page-1/#comment-1039</link>
		<dc:creator>Hawk</dc:creator>
		<pubDate>Tue, 23 May 2006 13:53:03 +0000</pubDate>
		<guid isPermaLink="false">http://pWhenpeoplethinkofwritingcode,theyoftenjustthinkofitaswritinginstructionstoperformacertainfunction.Littlecareisoftengiventohowthecodeispresented.Youmayask,what&#039;sthepoint?What&#039;sthedifference?Afterall,thecodesti#comment-1039</guid>
		<description>Exactly why i said only keep comments for complex code :). Much too often you&#039;ll see comments like this:
&lt;blockquote&gt;/* Loop to find if a value exists in array */&lt;/blockquote&gt;
Such comments are pretty pointless. If the code is performing a simple procedure, then it should easily describe itself.

Even for &quot;why&quot; that code is being used, it should only be written for good reason. Saying:
&lt;blockquote&gt;/* Used a bubble sort because I don&#039;t know how to write a better sorting algorithm */&lt;/blockquote&gt;
is bad since it doesn&#039;t help us in any way. But writing:
&lt;blockquote&gt;/* Added (code) to fix a BUG 1007 which caused memory leaks when (condition) */&lt;/blockquote&gt;
is acceptable. This provides information which you might not have known from just seeing the code.

As for more efficient ways... only our experience can help us in that. Comments won&#039;t do much much really.</description>
		<content:encoded><![CDATA[<p>Exactly why i said only keep comments for complex code <img src='http://www.dannyfoo.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Much too often you&#8217;ll see comments like this:</p>
<blockquote><p>/* Loop to find if a value exists in array */</p></blockquote>
<p>Such comments are pretty pointless. If the code is performing a simple procedure, then it should easily describe itself.</p>
<p>Even for &#8220;why&#8221; that code is being used, it should only be written for good reason. Saying:</p>
<blockquote><p>/* Used a bubble sort because I don&#8217;t know how to write a better sorting algorithm */</p></blockquote>
<p>is bad since it doesn&#8217;t help us in any way. But writing:</p>
<blockquote><p>/* Added (code) to fix a BUG 1007 which caused memory leaks when (condition) */</p></blockquote>
<p>is acceptable. This provides information which you might not have known from just seeing the code.</p>
<p>As for more efficient ways&#8230; only our experience can help us in that. Comments won&#8217;t do much much really.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sashi</title>
		<link>http://www.dannyfoo.com/blog/website-development/the-art-of-writing-code/comment-page-1/#comment-1038</link>
		<dc:creator>Sashi</dc:creator>
		<pubDate>Tue, 23 May 2006 09:14:45 +0000</pubDate>
		<guid isPermaLink="false">http://pWhenpeoplethinkofwritingcode,theyoftenjustthinkofitaswritinginstructionstoperformacertainfunction.Littlecareisoftengiventohowthecodeispresented.Youmayask,what&#039;sthepoint?What&#039;sthedifference?Afterall,thecodesti#comment-1038</guid>
		<description>I disagree with your opinions on comments. Good comment blocks aren&#039;t about describing procedures. It&#039;s about explaining why a piece is being used, and what is expected to be achieved. If I read someone&#039;s well-written code (without comments), sure I&#039;ll be able to understand what he&#039;s doing - but why did he use that code? Is there a more efficient way? None of these questions can be answered with good coding.</description>
		<content:encoded><![CDATA[<p>I disagree with your opinions on comments. Good comment blocks aren&#8217;t about describing procedures. It&#8217;s about explaining why a piece is being used, and what is expected to be achieved. If I read someone&#8217;s well-written code (without comments), sure I&#8217;ll be able to understand what he&#8217;s doing &#8211; but why did he use that code? Is there a more efficient way? None of these questions can be answered with good coding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hawk</title>
		<link>http://www.dannyfoo.com/blog/website-development/the-art-of-writing-code/comment-page-1/#comment-1037</link>
		<dc:creator>Hawk</dc:creator>
		<pubDate>Tue, 23 May 2006 08:58:36 +0000</pubDate>
		<guid isPermaLink="false">http://pWhenpeoplethinkofwritingcode,theyoftenjustthinkofitaswritinginstructionstoperformacertainfunction.Littlecareisoftengiventohowthecodeispresented.Youmayask,what&#039;sthepoint?What&#039;sthedifference?Afterall,thecodesti#comment-1037</guid>
		<description>That&#039;s pretty useless.... in ANY editor you&#039;ll have a find function. Use it :) If you wrote your code properly, segments should be easy to find since you named them well.

If you&#039;re using an IDE, some have code folding so the code isn&#039;t one big lump. If it doesn&#039;t have that feature, IDEs will often list out functions and classes used. It would be easy to jump around.

That said, if your code is too frigging long you probably need to refactorise your code somewhere. Break it out into smaller more manageable pieces.

Comments should only be used in 2 cases.

1) To describe a complex procedure
2) To generate documentation ala phpDoc or JavaDoc</description>
		<content:encoded><![CDATA[<p>That&#8217;s pretty useless&#8230;. in ANY editor you&#8217;ll have a find function. Use it <img src='http://www.dannyfoo.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  If you wrote your code properly, segments should be easy to find since you named them well.</p>
<p>If you&#8217;re using an IDE, some have code folding so the code isn&#8217;t one big lump. If it doesn&#8217;t have that feature, IDEs will often list out functions and classes used. It would be easy to jump around.</p>
<p>That said, if your code is too frigging long you probably need to refactorise your code somewhere. Break it out into smaller more manageable pieces.</p>
<p>Comments should only be used in 2 cases.</p>
<p>1) To describe a complex procedure<br />
2) To generate documentation ala phpDoc or JavaDoc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.dannyfoo.com/blog/website-development/the-art-of-writing-code/comment-page-1/#comment-1036</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 23 May 2006 01:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://pWhenpeoplethinkofwritingcode,theyoftenjustthinkofitaswritinginstructionstoperformacertainfunction.Littlecareisoftengiventohowthecodeispresented.Youmayask,what&#039;sthepoint?What&#039;sthedifference?Afterall,thecodesti#comment-1036</guid>
		<description>Good article Hawk!

I&#039;ve got something to say about comments too: Comments is cool.

If you&#039;ve got a lot of code, like pages and pages, comment headings can help you find the section you are looking for quickly, e.g.

&lt;code&gt;&lt;big&gt;/* ##### Section name ##### */&lt;/big&gt;&lt;/code&gt;

This serves as a visual marker so you can quickly scan your code, and not have to read it, so that you can find what you are looking for quickly.</description>
		<content:encoded><![CDATA[<p>Good article Hawk!</p>
<p>I&#8217;ve got something to say about comments too: Comments is cool.</p>
<p>If you&#8217;ve got a lot of code, like pages and pages, comment headings can help you find the section you are looking for quickly, e.g.</p>
<p><code><big>/* ##### Section name ##### */</big></code></p>
<p>This serves as a visual marker so you can quickly scan your code, and not have to read it, so that you can find what you are looking for quickly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hawk</title>
		<link>http://www.dannyfoo.com/blog/website-development/the-art-of-writing-code/comment-page-1/#comment-1035</link>
		<dc:creator>Hawk</dc:creator>
		<pubDate>Mon, 22 May 2006 08:43:33 +0000</pubDate>
		<guid isPermaLink="false">http://pWhenpeoplethinkofwritingcode,theyoftenjustthinkofitaswritinginstructionstoperformacertainfunction.Littlecareisoftengiventohowthecodeispresented.Youmayask,what&#039;sthepoint?What&#039;sthedifference?Afterall,thecodesti#comment-1035</guid>
		<description>&lt;blockquote&gt;&quot;well, the statements are actually for common casesÃ¢â‚¬Â¦ if your code is more concerntrated to its security, itÃ¢â‚¬â„¢s naming &amp; formatting should be misterious enough, to prevent hackingÃ¢â‚¬Â¦ ^^&quot;&lt;/blockquote&gt;

Not really, that is just security through obscruity. Your code itself should be strong enough that even when people see and understand it, it will be hard to break.

This is why the best encryption techniques are those that are open. It has to be reviewed by others to verify its strength.

&lt;blockquote&gt;&quot;DonÃ¢â‚¬â„¢t forget to add comments in your code! ;)&quot;&lt;/blockquote&gt;

I purposely left comments out :)
The purpose of this article is to show that your code is self documented. The code explains itself. You should only add comments to really complex code which gives the person a better understanding on what the heck you&#039;re doing.

Comments have the tendency of being out-of-date. Your code however will always be up to date. So only write comments if you have to, otherwise leave them out.</description>
		<content:encoded><![CDATA[<blockquote><p>&#8220;well, the statements are actually for common casesÃ¢â‚¬Â¦ if your code is more concerntrated to its security, itÃ¢â‚¬â„¢s naming &#038; formatting should be misterious enough, to prevent hackingÃ¢â‚¬Â¦ ^^&#8221;</p></blockquote>
<p>Not really, that is just security through obscruity. Your code itself should be strong enough that even when people see and understand it, it will be hard to break.</p>
<p>This is why the best encryption techniques are those that are open. It has to be reviewed by others to verify its strength.</p>
<blockquote><p>&#8220;DonÃ¢â‚¬â„¢t forget to add comments in your code! <img src='http://www.dannyfoo.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> &#8221;</p></blockquote>
<p>I purposely left comments out <img src='http://www.dannyfoo.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
The purpose of this article is to show that your code is self documented. The code explains itself. You should only add comments to really complex code which gives the person a better understanding on what the heck you&#8217;re doing.</p>
<p>Comments have the tendency of being out-of-date. Your code however will always be up to date. So only write comments if you have to, otherwise leave them out.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 7/25 queries in 0.022 seconds using disk: basic
Object Caching 430/448 objects using disk: basic

Served from: www.dannyfoo.com @ 2012-02-12 02:43:13 -->
