<?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: Just a taste &#8211;</title>
	<atom:link href="http://blog.theprodigalboyfriend.com/2008/03/11/just-a-taste/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.theprodigalboyfriend.com/2008/03/11/just-a-taste/</link>
	<description>Why are you even reading this?</description>
	<lastBuildDate>Thu, 21 Jan 2010 08:38:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Missy</title>
		<link>http://blog.theprodigalboyfriend.com/2008/03/11/just-a-taste/comment-page-1/#comment-827</link>
		<dc:creator>Missy</dc:creator>
		<pubDate>Mon, 23 Jun 2008 18:42:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/2008/03/11/just-a-taste/#comment-827</guid>
		<description>WTB more blogs please.  And in English.</description>
		<content:encoded><![CDATA[<p>WTB more blogs please.  And in English.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://blog.theprodigalboyfriend.com/2008/03/11/just-a-taste/comment-page-1/#comment-208</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Wed, 12 Mar 2008 18:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/2008/03/11/just-a-taste/#comment-208</guid>
		<description>It&#039;s my understanding from MSDN that 
&lt;pre lang=&quot;csharp&quot;&gt;using (
}&lt;/pre&gt;
Is essentially the same as:
&lt;pre lang=&quot;csharp&quot;&gt;try {
}
finally {
thing.dispose();
}&lt;/pre&gt;
I&#039;ve heard numerous complaints about Stream(Writer/Reader), SqlConnection, MailMessage, and a few others slowly hogging memory unless you explicitly dispose() them, since they&#039;re unmanaged objects.  &#160;

In any case, I don&#039;t see that it &lt;i&gt;needs&lt;/i&gt; a new namespace, but then, I haven&#039;t read C# Best Practices.  By Python/C++ reasoning, since there ought not to be any duplication of method/class/variable names in the class, a new namespace isn&#039;t necessary.  Any particular reason why I should use a namespace for it?&#160;

Yes, that&#039;s a complete if.  I could use &amp;&amp;, but it seems more readable without.&#160;

All the lblXXXX and txtXXXX methods are fucking &lt;b&gt;delegates&lt;/b&gt;.  Actually, the only delegates he had in the code.
&lt;pre lang=&quot;csharp&quot;&gt;public delegate void TextlblDisplayTodayAddCallback(string textdisplaytodayadd);
private void TextlblDisplayTodayAdd(string textdisplaytodayadd)
{
     try
     {
          if (lblFaxesTodayDisplay.InvokeRequired)
          {
               TextlblDisplayTodayAddCallback d = new
               TextlblDisplayTodayAddCallback(TextlblDisplayTodayAdd);
     Invoke(d, new object[] { textdisplaytodayadd });
          }
          else
          {
               lblFaxesTodayDisplay.Text = textdisplaytodayadd;
          }
     }
     catch (Exception f)
     {
     MessageBox.Show(&quot;Error : &quot; + f.Message);
     }
}&lt;/pre&gt;
Presumably this avoids deadlock conditions or... something.  I can&#039;t even tell what the fuck the point of it is.  A look on MSDN tells me that Windows forms are not threadsafe, and this is supposed to help that (since these are sometimes called from outside threads), but it seems kludgy.  I haven&#039;t looked into replacing these yet.  Still about halfway through the code trying to de-spaghettify it.&#160;

Tons of these around, too:
&lt;pre lang=&quot;csharp&quot;&gt;if (textBox1.Text == &quot;&quot;)
{
     TextbtnStartadd(&quot;The program is missing the ini file.  You are not allowed to start faxing.&quot;);
}
else
{
     Textbox1Append(&quot;\r\nThe program is missing the ini file.  You are not allowed to start faxing.&quot;);
}&lt;/pre&gt;
Some with slightly varying syntax, but they&#039;re all just a waste of code.</description>
		<content:encoded><![CDATA[<p>It&#8217;s my understanding from MSDN that</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">&#40;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Is essentially the same as:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">try</span> <span style="color: #000000;">&#123;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">finally</span> <span style="color: #000000;">&#123;</span>
thing.<span style="color: #0000FF;">dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>I&#8217;ve heard numerous complaints about Stream(Writer/Reader), SqlConnection, MailMessage, and a few others slowly hogging memory unless you explicitly dispose() them, since they&#8217;re unmanaged objects.  &nbsp;</p>
<p>In any case, I don&#8217;t see that it <i>needs</i> a new namespace, but then, I haven&#8217;t read C# Best Practices.  By Python/C++ reasoning, since there ought not to be any duplication of method/class/variable names in the class, a new namespace isn&#8217;t necessary.  Any particular reason why I should use a namespace for it?&nbsp;</p>
<p>Yes, that&#8217;s a complete if.  I could use &#038;&#038;, but it seems more readable without.&nbsp;</p>
<p>All the lblXXXX and txtXXXX methods are fucking <b>delegates</b>.  Actually, the only delegates he had in the code.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">delegate</span> <span style="color: #0600FF;">void</span> TextlblDisplayTodayAddCallback<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> textdisplaytodayadd<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> TextlblDisplayTodayAdd<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> textdisplaytodayadd<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
     <span style="color: #0600FF;">try</span>
     <span style="color: #000000;">&#123;</span>
          <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>lblFaxesTodayDisplay.<span style="color: #0000FF;">InvokeRequired</span><span style="color: #000000;">&#41;</span>
          <span style="color: #000000;">&#123;</span>
               TextlblDisplayTodayAddCallback d <span style="color: #008000;">=</span> <span style="color: #008000;">new</span>
               TextlblDisplayTodayAddCallback<span style="color: #000000;">&#40;</span>TextlblDisplayTodayAdd<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
     Invoke<span style="color: #000000;">&#40;</span>d, <span style="color: #008000;">new</span> <span style="color: #FF0000;">object</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#123;</span> textdisplaytodayadd <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
          <span style="color: #000000;">&#125;</span>
          <span style="color: #0600FF;">else</span>
          <span style="color: #000000;">&#123;</span>
               lblFaxesTodayDisplay.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> textdisplaytodayadd<span style="color: #008000;">;</span>
          <span style="color: #000000;">&#125;</span>
     <span style="color: #000000;">&#125;</span>
     <span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span>Exception f<span style="color: #000000;">&#41;</span>
     <span style="color: #000000;">&#123;</span>
     MessageBox.<span style="color: #0000FF;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Error : &quot;</span> <span style="color: #008000;">+</span> f.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
     <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Presumably this avoids deadlock conditions or&#8230; something.  I can&#8217;t even tell what the fuck the point of it is.  A look on MSDN tells me that Windows forms are not threadsafe, and this is supposed to help that (since these are sometimes called from outside threads), but it seems kludgy.  I haven&#8217;t looked into replacing these yet.  Still about halfway through the code trying to de-spaghettify it.&nbsp;</p>
<p>Tons of these around, too:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>textBox1.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
     TextbtnStartadd<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;The program is missing the ini file.  You are not allowed to start faxing.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
     Textbox1Append<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\r</span><span style="color: #008080; font-weight: bold;">\n</span>The program is missing the ini file.  You are not allowed to start faxing.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Some with slightly varying syntax, but they&#8217;re all just a waste of code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://blog.theprodigalboyfriend.com/2008/03/11/just-a-taste/comment-page-1/#comment-207</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Wed, 12 Mar 2008 17:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theprodigalboyfriend.com/2008/03/11/just-a-taste/#comment-207</guid>
		<description>Commenting on this in segments --

First, make namespaces and call them with using. Your first replacement block has reset.Dispose(), but you don&#039;t need to (and shouldn&#039;t, by best practices) call anything.Dispose(). If you call a using statement inside your method call/class, the class called by that statement will automatically be disposed when the call ends. Then again, you say memory management is not a real issue with this.

Also, because I don&#039;t see a /*snip*/ here, I&#039;m assuming this is a complete if statement?

if (totalSeconds % 3600 == 0)
{
     if (totalSeconds == 0)
     {
          log.Rotate(fileErrorLog);
          reset.Labels(true, true);
          reset.Counts(true, true);
     }
     else 
     {
          reset.Labels(false, true);
          reset.Labels(false, true);
     }
reset.Dispose();
}

If it is, you can use &amp;&amp; (as you used before) to save a bit on code complexity.

The various lblXXXX and txtXXXX methods in Form1 would probably be worthy of inclusion on the Daily WTF, because he&#039;s yet again reinventing the wheel. TextBox1Add(string), really? Not TextBox1.Text = TextBos1.Text.ToString() + string? I guess he doesn&#039;t know what boxing is, as we talked about yesterday.</description>
		<content:encoded><![CDATA[<p>Commenting on this in segments &#8211;</p>
<p>First, make namespaces and call them with using. Your first replacement block has reset.Dispose(), but you don&#8217;t need to (and shouldn&#8217;t, by best practices) call anything.Dispose(). If you call a using statement inside your method call/class, the class called by that statement will automatically be disposed when the call ends. Then again, you say memory management is not a real issue with this.</p>
<p>Also, because I don&#8217;t see a /*snip*/ here, I&#8217;m assuming this is a complete if statement?</p>
<p>if (totalSeconds % 3600 == 0)<br />
{<br />
     if (totalSeconds == 0)<br />
     {<br />
          log.Rotate(fileErrorLog);<br />
          reset.Labels(true, true);<br />
          reset.Counts(true, true);<br />
     }<br />
     else<br />
     {<br />
          reset.Labels(false, true);<br />
          reset.Labels(false, true);<br />
     }<br />
reset.Dispose();<br />
}</p>
<p>If it is, you can use &amp;&amp; (as you used before) to save a bit on code complexity.</p>
<p>The various lblXXXX and txtXXXX methods in Form1 would probably be worthy of inclusion on the Daily WTF, because he&#8217;s yet again reinventing the wheel. TextBox1Add(string), really? Not TextBox1.Text = TextBos1.Text.ToString() + string? I guess he doesn&#8217;t know what boxing is, as we talked about yesterday.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
