<?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 for Kevin William Pang</title>
	<atom:link href="http://www.kevinwilliampang.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kevinwilliampang.com</link>
	<description>ASP.NET Developer. ALT.NET Supporter. Pragmatic Programmer. Published Writer.</description>
	<lastBuildDate>Thu, 02 Sep 2010 01:11:40 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on A Programmer&#8217;s Plea to Laptop Makers by Knux Kitsune</title>
		<link>http://www.kevinwilliampang.com/2009/03/12/a-programmers-plea-to-laptop-makers/#comment-3744</link>
		<dc:creator>Knux Kitsune</dc:creator>
		<pubDate>Thu, 02 Sep 2010 01:11:40 +0000</pubDate>
		<guid isPermaLink="false">/post/A-Programmers-Plea-to-Laptop-Makers.aspx#comment-3744</guid>
		<description>Actually, my Home, End, Ins, Del, PgUp, PgDn on my DESKTOP keyboard aren&#039;t the normall 3x2...instead they&#039;re 2x3...which was a little disorienting at first, but I&#039;ve gotten used to it.  My arrangement is like this

[Hm][Ed]
[Ins][PU]
[De][PD]   

(abbreviated, the actual buttons aren&#039;t abbreviations, they actually have the words written out &quot;Insert&quot;, &quot;Delete&quot;, &quot;Page Down&quot;)</description>
		<content:encoded><![CDATA[<p>Actually, my Home, End, Ins, Del, PgUp, PgDn on my DESKTOP keyboard aren&#8217;t the normall 3&#215;2&#8230;instead they&#8217;re 2&#215;3&#8230;which was a little disorienting at first, but I&#8217;ve gotten used to it.  My arrangement is like this</p>
<p>[Hm][Ed]<br />
[Ins][PU]<br />
[De][PD]   </p>
<p>(abbreviated, the actual buttons aren&#8217;t abbreviations, they actually have the words written out &#8220;Insert&#8221;, &#8220;Delete&#8221;, &#8220;Page Down&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 10 Programming Proverbs Every Developer Should Know by Dan</title>
		<link>http://www.kevinwilliampang.com/2008/10/07/10-programming-proverbs-every-developer-should-know/#comment-3576</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Wed, 25 Aug 2010 00:17:39 +0000</pubDate>
		<guid isPermaLink="false">/post/Programming-Proverbs.aspx#comment-3576</guid>
		<description>Your first point is backwards.  &quot;There is no smoke without fire&quot; is not correct by any means.  There is ALWAYS smoke first due to heat, flames come later.  But, that&#039;s how you can re-write it to mean what you were trying to say.  &quot;There is never fire without having some smoke first. Learn to identify the smoke, and you will save yourself from the fire.&quot;  It&#039;s the same idea, only actually correct.</description>
		<content:encoded><![CDATA[<p>Your first point is backwards.  &#8220;There is no smoke without fire&#8221; is not correct by any means.  There is ALWAYS smoke first due to heat, flames come later.  But, that&#8217;s how you can re-write it to mean what you were trying to say.  &#8220;There is never fire without having some smoke first. Learn to identify the smoke, and you will save yourself from the fire.&#8221;  It&#8217;s the same idea, only actually correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Top 10 Things That Annoy Programmers by Simon2</title>
		<link>http://www.kevinwilliampang.com/2008/08/28/top-10-things-that-annoy-programmers/#comment-3248</link>
		<dc:creator>Simon2</dc:creator>
		<pubDate>Sat, 07 Aug 2010 23:33:33 +0000</pubDate>
		<guid isPermaLink="false">/post/Top-10-Things-That-Annoy-Programmers.aspx#comment-3248</guid>
		<description>You should go read the top 10 list again. You&#039;re optimisation offers nothing and in fact makes it harder for a future developer to understand because if there were a bug here it less represents the original algorithm that the original coder copied (and the future coder will google it and find it), it is more obscure and harder to understand and most modern compilers are highly efficient at optimising code. Personally I would explain the algorithm in the comments if it were not obvious. Less lines does not make better code.</description>
		<content:encoded><![CDATA[<p>You should go read the top 10 list again. You&#8217;re optimisation offers nothing and in fact makes it harder for a future developer to understand because if there were a bug here it less represents the original algorithm that the original coder copied (and the future coder will google it and find it), it is more obscure and harder to understand and most modern compilers are highly efficient at optimising code. Personally I would explain the algorithm in the comments if it were not obvious. Less lines does not make better code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Top 10 Things That Annoy Programmers by Simon2</title>
		<link>http://www.kevinwilliampang.com/2008/08/28/top-10-things-that-annoy-programmers/#comment-3247</link>
		<dc:creator>Simon2</dc:creator>
		<pubDate>Sat, 07 Aug 2010 22:40:56 +0000</pubDate>
		<guid isPermaLink="false">/post/Top-10-Things-That-Annoy-Programmers.aspx#comment-3247</guid>
		<description>Once I was allowed to because of a performance problem. I reimplemented a tree data structure implementation written by the lead developer which had &gt;10 classes as a hashlist of hashlists. It was very rewarding because the performance issue was solved and with 1 class with less than a page of code was required.</description>
		<content:encoded><![CDATA[<p>Once I was allowed to because of a performance problem. I reimplemented a tree data structure implementation written by the lead developer which had &gt;10 classes as a hashlist of hashlists. It was very rewarding because the performance issue was solved and with 1 class with less than a page of code was required.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Top 10 Things That Annoy Programmers by Simon2</title>
		<link>http://www.kevinwilliampang.com/2008/08/28/top-10-things-that-annoy-programmers/#comment-3246</link>
		<dc:creator>Simon2</dc:creator>
		<pubDate>Sat, 07 Aug 2010 22:27:52 +0000</pubDate>
		<guid isPermaLink="false">/post/Top-10-Things-That-Annoy-Programmers.aspx#comment-3246</guid>
		<description>Yes, I feel the same.

Often you develop something under tight deadlines and with no real specifications or design and then the code creep; developers were never involved in the selling process of non-existent features so you can&#039;t go ask the customer what the specifications should be and the sales team has no idea. Lack of documentation means the developers then make best guess at interfaces and API&#039;s and make assumptions about business processes. So, when with hindsight, you can revisit something you did under those conditions you can rebuild it with better understanding. I so infrequently get that opportunity.</description>
		<content:encoded><![CDATA[<p>Yes, I feel the same.</p>
<p>Often you develop something under tight deadlines and with no real specifications or design and then the code creep; developers were never involved in the selling process of non-existent features so you can&#8217;t go ask the customer what the specifications should be and the sales team has no idea. Lack of documentation means the developers then make best guess at interfaces and API&#8217;s and make assumptions about business processes. So, when with hindsight, you can revisit something you did under those conditions you can rebuild it with better understanding. I so infrequently get that opportunity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Top 10 Things That Annoy Programmers by Elia</title>
		<link>http://www.kevinwilliampang.com/2008/08/28/top-10-things-that-annoy-programmers/#comment-3124</link>
		<dc:creator>Elia</dc:creator>
		<pubDate>Sat, 31 Jul 2010 16:30:36 +0000</pubDate>
		<guid isPermaLink="false">/post/Top-10-Things-That-Annoy-Programmers.aspx#comment-3124</guid>
		<description>Perfect, man! Congratulations! Do you know if there is already a brazilian portuguese translation for that post?</description>
		<content:encoded><![CDATA[<p>Perfect, man! Congratulations! Do you know if there is already a brazilian portuguese translation for that post?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Setting up ASP.NET MVC with Fluent NHibernate and StructureMap by Kevin Pang</title>
		<link>http://www.kevinwilliampang.com/2010/04/06/setting-up-asp-net-mvc-with-fluent-nhibernate-and-structuremap/#comment-2985</link>
		<dc:creator>Kevin Pang</dc:creator>
		<pubDate>Fri, 23 Jul 2010 18:07:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevinwilliampang.com/?p=353#comment-2985</guid>
		<description>Here&#039;s a sample unit test using the DatabaseTest class:

public class UserRepositoryTests : DatabaseTest
{
[Test]
public void Test_Get_By_User_Id()
{
var userRepository = new UserRepository(session);

var user = userRepository.GetByUserId(1);

Assert.IsNotNull(user);
}
}</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a sample unit test using the DatabaseTest class:</p>
<p>public class UserRepositoryTests : DatabaseTest<br />
{<br />
[Test]<br />
public void Test_Get_By_User_Id()<br />
{<br />
var userRepository = new UserRepository(session);</p>
<p>var user = userRepository.GetByUserId(1);</p>
<p>Assert.IsNotNull(user);<br />
}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Setting up ASP.NET MVC with Fluent NHibernate and StructureMap by Kevin Pang</title>
		<link>http://www.kevinwilliampang.com/2010/04/06/setting-up-asp-net-mvc-with-fluent-nhibernate-and-structuremap/#comment-2984</link>
		<dc:creator>Kevin Pang</dc:creator>
		<pubDate>Fri, 23 Jul 2010 18:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevinwilliampang.com/?p=353#comment-2984</guid>
		<description>Here&#039;s my DatabaseTest class:

public class DatabaseTest
{
 	protected ISessionFactory sessionFactory;
 	protected ISession session;
 	
        public DatabaseTest()
        {
                 sessionFactory = CreateSessionFactory();
        }

 	public void SetUp()
 	{
        	session = sessionFactory.OpenSession();
 	}
 	
 	public void TearDown()
 	{
 	        if (session != null &amp;&amp; session.IsOpen)
                	session.Close();
 	}
} 

I have to manually call SetUp() and TearDown() from the setup/teardown routines in any classes that inherit from this (I ran into a problem using the SetUp and TearDown attributes in DatabaseTest because NUnit seemed to not call them if I also had functions in the child class with SetUp and TearDown attributes).

This ensures that before each test is run I have a clean ISession to use and that it&#039;s properly disposed of after each test is run.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s my DatabaseTest class:</p>
<p>public class DatabaseTest<br />
{<br />
 	protected ISessionFactory sessionFactory;<br />
 	protected ISession session;</p>
<p>        public DatabaseTest()<br />
        {<br />
                 sessionFactory = CreateSessionFactory();<br />
        }</p>
<p> 	public void SetUp()<br />
 	{<br />
        	session = sessionFactory.OpenSession();<br />
 	}</p>
<p> 	public void TearDown()<br />
 	{<br />
 	        if (session != null &#038;&#038; session.IsOpen)<br />
                	session.Close();<br />
 	}<br />
} </p>
<p>I have to manually call SetUp() and TearDown() from the setup/teardown routines in any classes that inherit from this (I ran into a problem using the SetUp and TearDown attributes in DatabaseTest because NUnit seemed to not call them if I also had functions in the child class with SetUp and TearDown attributes).</p>
<p>This ensures that before each test is run I have a clean ISession to use and that it&#8217;s properly disposed of after each test is run.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Setting up ASP.NET MVC with Fluent NHibernate and StructureMap by Robert</title>
		<link>http://www.kevinwilliampang.com/2010/04/06/setting-up-asp-net-mvc-with-fluent-nhibernate-and-structuremap/#comment-2983</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Fri, 23 Jul 2010 16:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevinwilliampang.com/?p=353#comment-2983</guid>
		<description>Can you post the code for your DatabaseTest base class and how it&#039;s used in your TestSetup/TestFixtureSetup?  We have an environment where our legacy database has a lot of business logic in triggers and so on, so we need integration tests that actually hit the database, so I would love to see how you handle database integration testing.</description>
		<content:encoded><![CDATA[<p>Can you post the code for your DatabaseTest base class and how it&#8217;s used in your TestSetup/TestFixtureSetup?  We have an environment where our legacy database has a lot of business logic in triggers and so on, so we need integration tests that actually hit the database, so I would love to see how you handle database integration testing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Setting up ASP.NET MVC with Fluent NHibernate and StructureMap by Kevin Pang</title>
		<link>http://www.kevinwilliampang.com/2010/04/06/setting-up-asp-net-mvc-with-fluent-nhibernate-and-structuremap/#comment-2503</link>
		<dc:creator>Kevin Pang</dc:creator>
		<pubDate>Wed, 21 Jul 2010 18:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.kevinwilliampang.com/?p=353#comment-2503</guid>
		<description>You&#039;re right in that if you want to unit test your data access layer using this setup, your unit tests will have to be responsible for NHibernate session management.. What I&#039;ve done in my project is create a DatabaseTest base class that handles this in each TestSetup. It&#039;s a little bit of extra work and code duplication, but it hasn&#039;t bothered me so far.

For unit tests on classes that utilize the data access layer, you won&#039;t want to be connecting to a live database anyways so you can simply stub/mock out your repositories and not have to worry about creating NHibernate sessions.</description>
		<content:encoded><![CDATA[<p>You&#8217;re right in that if you want to unit test your data access layer using this setup, your unit tests will have to be responsible for NHibernate session management.. What I&#8217;ve done in my project is create a DatabaseTest base class that handles this in each TestSetup. It&#8217;s a little bit of extra work and code duplication, but it hasn&#8217;t bothered me so far.</p>
<p>For unit tests on classes that utilize the data access layer, you won&#8217;t want to be connecting to a live database anyways so you can simply stub/mock out your repositories and not have to worry about creating NHibernate sessions.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
