<?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>properties vs. fields... again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/02/08/properties-vs-fields-again.aspx</link><description>Eric Gunnerson just posted Properties vs public fields redux... It's no secret that I agree with Eric whole-heartedly on this matter. I've posted about this before as well: http://blogs.msdn.com/jaybaz_ms/archive/2004/04/29/123333.aspx . Fundementally,</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: properties vs. fields... again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/02/08/properties-vs-fields-again.aspx#1630641</link><pubDate>Fri, 09 Feb 2007 03:23:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1630641</guid><dc:creator>Miral</dc:creator><description>&lt;p&gt;The factory should probably be a standalone class, rather than a subclass of MyClass. &amp;nbsp;Then you can make the factory public and MyClass private, and then you're free to do whatever the heck you want with MyClass (including renaming it or deleting it).&lt;/p&gt;
&lt;p&gt;At least as long as it's not binary serializable, anyway.&lt;/p&gt;</description></item><item><title>re: properties vs. fields... again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/02/08/properties-vs-fields-again.aspx#1630843</link><pubDate>Fri, 09 Feb 2007 04:16:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1630843</guid><dc:creator>jaybaz_MS</dc:creator><description>&lt;p&gt;Good call, Miral.&lt;/p&gt;
&lt;p&gt;This all fits in to the more general statement of &amp;quot;future proofing is hard&amp;quot;. :-)&lt;/p&gt;
</description></item><item><title>re: properties vs. fields... again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/02/08/properties-vs-fields-again.aspx#1633282</link><pubDate>Fri, 09 Feb 2007 12:39:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1633282</guid><dc:creator>Bjørn Reppen</dc:creator><description>&lt;p&gt;Hooah! &amp;nbsp;The world is sane after all.&lt;/p&gt;
&lt;p&gt;Thanks man. Great post.&lt;/p&gt;</description></item><item><title>re: properties vs. fields... again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/02/08/properties-vs-fields-again.aspx#1657126</link><pubDate>Mon, 12 Feb 2007 06:48:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1657126</guid><dc:creator>Keith Nicholas</dc:creator><description>&lt;p&gt;---&lt;/p&gt;
&lt;p&gt;I have to write too much code for my code to be future proof so therefore I write non future proof code because I have the foresight to see the future for this code?!? &lt;/p&gt;
&lt;p&gt;---&lt;/p&gt;
&lt;p&gt;Or alternatively, you gamble on the odds of needing future proof code.&lt;/p&gt;
&lt;p&gt;Why can't we have a language where we can write &amp;nbsp; simple code that is future proof?&lt;/p&gt;
&lt;p&gt;Then we don't need to have these daft arguments about &amp;quot;good&amp;quot; code design / rules. &lt;/p&gt;
&lt;p&gt;I think its worth remembering these aren't good design principles, these things are &amp;quot;hacks&amp;quot; around language difficulties. &amp;nbsp;Don't get me wrong, It's not that these ideas are without merit, they certainly help you work within the bounds of C#, but its worth keeping it in mind that they are simply hacks and the &amp;quot;rules/guidance&amp;quot; would disappear if the language allowed you to express what you wanted.&lt;/p&gt;</description></item><item><title>re: properties vs. fields... again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/02/08/properties-vs-fields-again.aspx#1726408</link><pubDate>Tue, 20 Feb 2007 16:59:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1726408</guid><dc:creator>Steve</dc:creator><description>&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://codebetter.com/blogs/jeremy.miller/archive/2007/01/08/Orthogonal-Code.aspx"&gt;http://codebetter.com/blogs/jeremy.miller/archive/2007/01/08/Orthogonal-Code.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://codebetter.com/blogs/jeremy.miller/archive/2006/12/06/On-Writing-Maintainable-Code.aspx"&gt;http://codebetter.com/blogs/jeremy.miller/archive/2006/12/06/On-Writing-Maintainable-Code.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: properties vs. fields... again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/02/08/properties-vs-fields-again.aspx#1728626</link><pubDate>Tue, 20 Feb 2007 22:09:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1728626</guid><dc:creator>Jeremy</dc:creator><description>&lt;P&gt;"Constructors lock you in to a type. If you really want binary &amp;nbsp;compatibility, you should stop providing ctors, and start providing factory methods:"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;public class MyClass&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MyClass() { }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static MyClass New() { return new MyClass(); }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;
&lt;P&gt;You don't need to do this. &amp;nbsp;Just use Constructor Injection to push in IMyClass instances into the dependent classes, then use an IoC tool if you want to do the mechanical work.&lt;/P&gt;
&lt;P&gt;You'll end up with potentially more flexibility without having to go out of your way when you're building classes.&lt;/P&gt;</description></item></channel></rss>