<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programming Proverbs 11: Use intermediate variables properly</title><link>http://blogs.msdn.com/alfredth/archive/2007/03/15/programming-proverbs-11.aspx</link><description>Intermediate variables are variables that are used to break calculations down into several steps. For example the use of intermediate variables takes something like this: x = a + b * (sqrt(y) + w) and turns it into something like this: var1 = a + b var2</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Programming Proverbs 11: Use intermediate variables properly</title><link>http://blogs.msdn.com/alfredth/archive/2007/03/15/programming-proverbs-11.aspx#1885201</link><pubDate>Thu, 15 Mar 2007 09:41:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1885201</guid><dc:creator>Henning Krapoth</dc:creator><description>&lt;p&gt;x = a + b * (sqrt(y) + w)&lt;/p&gt;
&lt;p&gt;and turns it into something like this:&lt;/p&gt;
&lt;p&gt;var1 = a + b &lt;/p&gt;
&lt;p&gt;var2 = sqrt(y) + w&lt;/p&gt;
&lt;p&gt;x = var1 * var2 &lt;/p&gt;
&lt;p&gt;You might be getting different results with these ;-)&lt;/p&gt;
</description></item><item><title>re: Programming Proverbs 11: Use intermediate variables properly</title><link>http://blogs.msdn.com/alfredth/archive/2007/03/15/programming-proverbs-11.aspx#1886357</link><pubDate>Thu, 15 Mar 2007 13:37:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1886357</guid><dc:creator>Yousuf</dc:creator><description>&lt;p&gt;x = a + b * (sqrt(y) + w)&lt;/p&gt;
&lt;p&gt;and turns it into something like this:&lt;/p&gt;
&lt;p&gt;var1 = a + b&lt;/p&gt;
&lt;p&gt;var2 = sqrt(y) + w&lt;/p&gt;
&lt;p&gt;x = var1 * var2 &lt;/p&gt;
&lt;p&gt;Yes, the correct code example should be look like;&lt;/p&gt;
&lt;p&gt;var = b * (sqrt(y) + w)&lt;/p&gt;
&lt;p&gt;x= a + var&lt;/p&gt;
&lt;p&gt;and for the sake of post &amp;quot;Intermediate Variables...&amp;quot;;&lt;/p&gt;
&lt;p&gt;var1= sqrt(y) + w&lt;/p&gt;
&lt;p&gt;var2= b * var1&lt;/p&gt;
&lt;p&gt;x = a + var2&lt;/p&gt;
</description></item><item><title>re: Programming Proverbs 11: Use intermediate variables properly</title><link>http://blogs.msdn.com/alfredth/archive/2007/03/15/programming-proverbs-11.aspx#1887594</link><pubDate>Thu, 15 Mar 2007 17:31:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1887594</guid><dc:creator>Alfred Thompson</dc:creator><description>&lt;p&gt;The last couple of comments show three things. One is that mesing with too many intermediate variables can get one into trouble. And secondly one really does need to test their algorythms completely before putting them into a program. Lastly (until someone comments with more) that a good code review can go a long way towards improving quality. Thanks for the code reviews!&lt;/p&gt;
</description></item><item><title>re: Programming Proverbs 11: Use intermediate variables properly</title><link>http://blogs.msdn.com/alfredth/archive/2007/03/15/programming-proverbs-11.aspx#1888783</link><pubDate>Thu, 15 Mar 2007 21:00:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1888783</guid><dc:creator>Rick</dc:creator><description>&lt;p&gt;In my experience intermediate variables make source level debugging much easier too. &amp;nbsp;They make it easier to see where in the overall calculation your error is.&lt;/p&gt;
</description></item><item><title>re: Programming Proverbs 11: Use intermediate variables properly</title><link>http://blogs.msdn.com/alfredth/archive/2007/03/15/programming-proverbs-11.aspx#1915614</link><pubDate>Tue, 20 Mar 2007 03:13:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1915614</guid><dc:creator>Jeff</dc:creator><description>&lt;p&gt;I second Rick's observation. &amp;nbsp;The main reason I use intermediate variables is to make the code easier to inspect in the debugger.&lt;/p&gt;
</description></item></channel></rss>