<?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: Eye, Aye I!</title>
	<atom:link href="http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/feed/" rel="self" type="application/rss+xml" />
	<link>http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/</link>
	<description>Thoughts on embedded systems by Nigel Jones</description>
	<lastBuildDate>Sun, 06 May 2012 10:34:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Greg Giese</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/comment-page-1/#comment-416</link>
		<dc:creator>Greg Giese</dc:creator>
		<pubDate>Thu, 04 Mar 2010 00:04:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/11/06/eye-aye-i/#comment-416</guid>
		<description>I am fully onboard with the embedded standards but seriously the large variable name for a looping variable in a simple loop is more distracting than useful. As a safety system programmer I would reject such code based on distraction. If i have multiple loops within loops I would demand documentation of the loop vars themselves. If that in itself, causes less clarity in the code then perhaps the coder mis-named the arrays/structures being indexed.</description>
		<content:encoded><![CDATA[<p>I am fully onboard with the embedded standards but seriously the large variable name for a looping variable in a simple loop is more distracting than useful. As a safety system programmer I would reject such code based on distraction. If i have multiple loops within loops I would demand documentation of the loop vars themselves. If that in itself, causes less clarity in the code then perhaps the coder mis-named the arrays/structures being indexed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: K1200LT Rider</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/comment-page-1/#comment-339</link>
		<dc:creator>K1200LT Rider</dc:creator>
		<pubDate>Mon, 21 Dec 2009 19:23:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/11/06/eye-aye-i/#comment-339</guid>
		<description>I&#039;m glad someone else came to the same conclusion as I have about using &#039;i&#039;.  I also agree with Jonathan.Good subject.</description>
		<content:encoded><![CDATA[<p>I&#39;m glad someone else came to the same conclusion as I have about using &#39;i&#39;.  I also agree with Jonathan.Good subject.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/comment-page-1/#comment-338</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Thu, 26 Nov 2009 13:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/11/06/eye-aye-i/#comment-338</guid>
		<description>I realize that your comment was made in jest Kyle. However I think you do raise an interesting point. A few years ago (OK maybe 10), Hungarian notation was all the rage. I hated it and only used it if mandated by a client&#039;s coding standard. Since then the industry seems to have come around to my way of thinking :-). Perhaps the same thing will hold true for loop variable names in a few years!</description>
		<content:encoded><![CDATA[<p>I realize that your comment was made in jest Kyle. However I think you do raise an interesting point. A few years ago (OK maybe 10), Hungarian notation was all the rage. I hated it and only used it if mandated by a client&#39;s coding standard. Since then the industry seems to have come around to my way of thinking <img src='http://embeddedgurus.com/stack-overflow/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Perhaps the same thing will hold true for loop variable names in a few years!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Bostian</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/comment-page-1/#comment-337</link>
		<dc:creator>Kyle Bostian</dc:creator>
		<pubDate>Mon, 09 Nov 2009 14:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/11/06/eye-aye-i/#comment-337</guid>
		<description>I think you could make the second example even more clear by adding Hungarian notation into the mix. :)  (running and ducking for cover...)</description>
		<content:encoded><![CDATA[<p>I think you could make the second example even more clear by adding Hungarian notation into the mix. <img src='http://embeddedgurus.com/stack-overflow/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   (running and ducking for cover&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/comment-page-1/#comment-336</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Sun, 08 Nov 2009 21:20:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/11/06/eye-aye-i/#comment-336</guid>
		<description>I prefer the look of the code implemented with the &quot;uint8_t i&quot; but I think the reason I try to use idx is so that I can search for all occurrences of the variable with a regular text editor, my search results are not polluted with all the appearances of the letter i within the keywords &quot;if&quot;, &quot;switch&quot; etc. &quot;uint8_t x&quot; works out a little better from a probabalistic standpoint, but I think the three letter minimum is to encourage meaningful names, and also to prevent false positives in searches.</description>
		<content:encoded><![CDATA[<p>I prefer the look of the code implemented with the &quot;uint8_t i&quot; but I think the reason I try to use idx is so that I can search for all occurrences of the variable with a regular text editor, my search results are not polluted with all the appearances of the letter i within the keywords &quot;if&quot;, &quot;switch&quot; etc. &quot;uint8_t x&quot; works out a little better from a probabalistic standpoint, but I think the three letter minimum is to encourage meaningful names, and also to prevent false positives in searches.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/comment-page-1/#comment-335</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Sat, 07 Nov 2009 00:53:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/11/06/eye-aye-i/#comment-335</guid>
		<description>Jonathon - thanks for your thoughtful comments. I agree that the use of i,j,k can get out of hand. I can&#039;t say I&#039;ve never done this - but it&#039;s rare.The concept of &#039;Industry best practices&#039; is indeed a bit nebulous. There are certainly &#039;standards&#039; such as MISRA. However, although whereas I&#039;m sure there will not be much disagreement that prototyping functions should be mandatory (and hence could be considered an industry best practice), the same is not true for other things (e.g. casting integers to pointers). I also spotted their claim that the form &quot;if (x == TRUE)&quot; is better than &quot;if (x)&quot;. I actually disagree with them. I&#039;ll often have variables named thus:bool isFull;I can then write code that reads very naturally:if (isFull){...}If I&#039;m forced into using an explicit comparison, the code becomes:if (isFull == TRUE){...}Now, because this construct is vulnerable to the = / == dichotomy,my coding standard requires that constants appear on the LHS, and so I have to write:if (TRUE == isFull){...}The result is ugly, harder to read and has achieved nothing. Hence I must respectively disagree with DSDI.I&#039;m glad you find the posts thought provoking. Quite frankly one of the reasons I do this is because I in turn find comments such as yours thought provoking! Symbiosis has been achieved!</description>
		<content:encoded><![CDATA[<p>Jonathon &#8211; thanks for your thoughtful comments. I agree that the use of i,j,k can get out of hand. I can&#39;t say I&#39;ve never done this &#8211; but it&#39;s rare.The concept of &#39;Industry best practices&#39; is indeed a bit nebulous. There are certainly &#39;standards&#39; such as MISRA. However, although whereas I&#39;m sure there will not be much disagreement that prototyping functions should be mandatory (and hence could be considered an industry best practice), the same is not true for other things (e.g. casting integers to pointers). I also spotted their claim that the form &quot;if (x == TRUE)&quot; is better than &quot;if (x)&quot;. I actually disagree with them. I&#39;ll often have variables named thus:bool isFull;I can then write code that reads very naturally:if (isFull){&#8230;}If I&#39;m forced into using an explicit comparison, the code becomes:if (isFull == TRUE){&#8230;}Now, because this construct is vulnerable to the = / == dichotomy,my coding standard requires that constants appear on the LHS, and so I have to write:if (TRUE == isFull){&#8230;}The result is ugly, harder to read and has achieved nothing. Hence I must respectively disagree with DSDI.I&#39;m glad you find the posts thought provoking. Quite frankly one of the reasons I do this is because I in turn find comments such as yours thought provoking! Symbiosis has been achieved!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/11/eye-aye-i/comment-page-1/#comment-334</link>
		<dc:creator>Jonathan Jones</dc:creator>
		<pubDate>Fri, 06 Nov 2009 21:53:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/11/06/eye-aye-i/#comment-334</guid>
		<description>If the code fragment contained multiple array indices it would definitely be better to label each with their function (e.g. DayIdx, HourIdx) instead of using i, j, k...If the code contained even one more scratch variable, say a sum of array values, it would be worth labelling the array index as such to avoid confusion.However as it stands your code is perfectly legible and &#039;i&#039; is no better or worse than &#039;idx&#039; in this examples.My preference is to keep variable names short, because I find it makes code more readable.Three more points :-1. This comment is only my opinion. The author of the DSDI report has referred to &quot;Industry best practices&quot;. Is there really a global consensus as to what is best practice or should the report author have referenced a specific published standard / labelled it as their (expert) opinion ?2. In Appendix B of the report, it is stated that a conditional of the form &quot;if (x == TRUE)&quot; is better practice than &quot;if (x)&quot;. Would you agree ?3. Thanks! I&#039;m finding your posts thought provoking.</description>
		<content:encoded><![CDATA[<p>If the code fragment contained multiple array indices it would definitely be better to label each with their function (e.g. DayIdx, HourIdx) instead of using i, j, k&#8230;If the code contained even one more scratch variable, say a sum of array values, it would be worth labelling the array index as such to avoid confusion.However as it stands your code is perfectly legible and &#39;i&#39; is no better or worse than &#39;idx&#39; in this examples.My preference is to keep variable names short, because I find it makes code more readable.Three more points :-1. This comment is only my opinion. The author of the DSDI report has referred to &quot;Industry best practices&quot;. Is there really a global consensus as to what is best practice or should the report author have referenced a specific published standard / labelled it as their (expert) opinion ?2. In Appendix B of the report, it is stated that a conditional of the form &quot;if (x == TRUE)&quot; is better practice than &quot;if (x)&quot;. Would you agree ?3. Thanks! I&#39;m finding your posts thought provoking.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

