<?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: A Challenge to Microsoft, Scott Guthrie</title>
	<atom:link href="http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/</link>
	<description>Software development, testing, and techie life</description>
	<lastBuildDate>Thu, 08 Mar 2012 22:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: chadmyers</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-33</link>
		<dc:creator>chadmyers</dc:creator>
		<pubDate>Sat, 12 Jan 2008 13:31:26 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-33</guid>
		<description>Andrey:

Breaking changes have historically not been a problem for me, so I&#039;m happy if API designers make breaking changes as long as there is a good benefit to the API.

What has historically ALWAYS been a problem for me is that there is a bug or critical piece of functionality I need to override or change for a specific project, but that functionality is locked up inside an internal sealed class and I&#039;m screwed.

I agree with the Interfaces, but currently there&#039;s no other way around it. So unless you&#039;re advocating I dump C# and .NET and go with something like Ruby, I&#039;m not sure what your point is, really.</description>
		<content:encoded><![CDATA[<p>Andrey:</p>
<p>Breaking changes have historically not been a problem for me, so I&#8217;m happy if API designers make breaking changes as long as there is a good benefit to the API.</p>
<p>What has historically ALWAYS been a problem for me is that there is a bug or critical piece of functionality I need to override or change for a specific project, but that functionality is locked up inside an internal sealed class and I&#8217;m screwed.</p>
<p>I agree with the Interfaces, but currently there&#8217;s no other way around it. So unless you&#8217;re advocating I dump C# and .NET and go with something like Ruby, I&#8217;m not sure what your point is, really.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey Shchekin</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-32</link>
		<dc:creator>Andrey Shchekin</dc:creator>
		<pubDate>Sat, 12 Jan 2008 09:07:35 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-32</guid>
		<description>I think it is a really bad idea, since for Microsoft exposing everything means freezing every little bit of API forever. 

And extensibility is not just &quot;everything is public and virtual&quot;.

For example, in MbUnit internals there are certain interfaces that I am allowed to implement, but my implementation will never be used by MbUnit. There is no way to configure the class that uses these interfaces to load more then several hardcoded implementations. Even if everything was public, it would not have helped me, since there is no way to find this class instance and modify it&#039;s collections.

Also, the fascination with interfaces in .Net community makes people forget that testable interfaces with only a single implementation are just a way to overcome limitations of a framework -- while I use it, I feel it to be an anti-pattern. No SPOT, no DRY. Should we really recommend a workaround as a best practice in API design?

I would definitely prefer a way to mock File.ReadAllText over using the abstract reader factory or IoC -- if we all we want now is read a text from file, I&#039;ll follow YAGNI and KISS.</description>
		<content:encoded><![CDATA[<p>I think it is a really bad idea, since for Microsoft exposing everything means freezing every little bit of API forever. </p>
<p>And extensibility is not just &#8220;everything is public and virtual&#8221;.</p>
<p>For example, in MbUnit internals there are certain interfaces that I am allowed to implement, but my implementation will never be used by MbUnit. There is no way to configure the class that uses these interfaces to load more then several hardcoded implementations. Even if everything was public, it would not have helped me, since there is no way to find this class instance and modify it&#8217;s collections.</p>
<p>Also, the fascination with interfaces in .Net community makes people forget that testable interfaces with only a single implementation are just a way to overcome limitations of a framework &#8212; while I use it, I feel it to be an anti-pattern. No SPOT, no DRY. Should we really recommend a workaround as a best practice in API design?</p>
<p>I would definitely prefer a way to mock File.ReadAllText over using the abstract reader factory or IoC &#8212; if we all we want now is read a text from file, I&#8217;ll follow YAGNI and KISS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-31</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Tue, 08 Jan 2008 19:31:11 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-31</guid>
		<description>I do recommend Cwalina&#039;s Framework Design Guidelines, it was pretty much required reading at a company I worked at where one of our deliverables for our product was an API.  If covers items like naming, usage, and design guidelines.  Such as, correct way to expose an event.  Stuff we popped open Reflector to see how MS did it.

I really don&#039;t mind things being private, non-virtual, etc.  As long as they program to abstractions and interfaces, I&#039;m OK.  The larger the public surface area of an API, the less useful it tends to be as a large surface area can hinder discoverability.  Make interfaces/behavior public, implementations private, that&#039;s fine by me.</description>
		<content:encoded><![CDATA[<p>I do recommend Cwalina&#8217;s Framework Design Guidelines, it was pretty much required reading at a company I worked at where one of our deliverables for our product was an API.  If covers items like naming, usage, and design guidelines.  Such as, correct way to expose an event.  Stuff we popped open Reflector to see how MS did it.</p>
<p>I really don&#8217;t mind things being private, non-virtual, etc.  As long as they program to abstractions and interfaces, I&#8217;m OK.  The larger the public surface area of an API, the less useful it tends to be as a large surface area can hinder discoverability.  Make interfaces/behavior public, implementations private, that&#8217;s fine by me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omer Rauchwerger</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-30</link>
		<dc:creator>Omer Rauchwerger</dc:creator>
		<pubDate>Mon, 07 Jan 2008 15:51:55 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-30</guid>
		<description>Chad,

Point taken, thank you.

Btw, When I wrote &#039;InitializeSQLProps&#039; I was thinking of &#039;SetSQLProps&#039; taken from a generated SubSonic class I was just working with which has no justification of being public. However I wouldn&#039;t think of generated SubSonic classes as ordinary public API.</description>
		<content:encoded><![CDATA[<p>Chad,</p>
<p>Point taken, thank you.</p>
<p>Btw, When I wrote &#8216;InitializeSQLProps&#8217; I was thinking of &#8216;SetSQLProps&#8217; taken from a generated SubSonic class I was just working with which has no justification of being public. However I wouldn&#8217;t think of generated SubSonic classes as ordinary public API.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chadmyers</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-29</link>
		<dc:creator>chadmyers</dc:creator>
		<pubDate>Mon, 07 Jan 2008 15:32:59 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-29</guid>
		<description>@Omer I&#039;m not saying to break encapsulation, I&#039;m saying that you should design your classes in such a way as to minimize the amount of &#039;private&#039; things you are doing.

In my experience, &#039;private&#039; methods in public APIs tend to be dirty little bits of procedural code that glue two otherwise-poorly-designed components together.  I&#039;m guilty of this and it has caused my customers and other developers consuming that API no end of grief.

In the &#039;InitializeSQLProps&#039;, this sounds like a big, ugly procedural method whose functionality could otherwise be accomplished with more elegance and reusability, such as declarative configuration or through a configuration API of some sort.

So you see, my point is something like this: &quot;If you feel the need to do something in a private method, there&#039;s probably a better way to do it that doesn&#039;t involve a private method and would allow for greater customization and re-usability/re-purposing of your API  in the field.&quot;

I&#039;m not saying &quot;just make every private method public&quot; and cluttering up your API, I&#039;m saying &quot;design in such a way that you no longer need that private method&quot;

If you really MUST have something that&#039;s hidden or private, at least make it PROTECTED and VIRTUAL at that.

Final thought: Your primary goal as an API writer should be to allow consumers of your API to use it to fit their purposes. Providing convenient functionality is #2 priority.  You will NEVER be able to predict how your API will be used in-the-field, so you MUST allow for it to be used in ways you didn&#039;t expect. This means that you should, to the maximum extent possible, allow consumers to override, extend, and even replace parts of your API.

Using test-driven development (NOT testing after-the-fact, although that still provides some benefit) will help you to design with extensibility and replace-ability in mind.  Using TDD, you necessarily FORCE yourself to think as a user, using your API in different ways than it was originally designed for</description>
		<content:encoded><![CDATA[<p>@Omer I&#8217;m not saying to break encapsulation, I&#8217;m saying that you should design your classes in such a way as to minimize the amount of &#8216;private&#8217; things you are doing.</p>
<p>In my experience, &#8216;private&#8217; methods in public APIs tend to be dirty little bits of procedural code that glue two otherwise-poorly-designed components together.  I&#8217;m guilty of this and it has caused my customers and other developers consuming that API no end of grief.</p>
<p>In the &#8216;InitializeSQLProps&#8217;, this sounds like a big, ugly procedural method whose functionality could otherwise be accomplished with more elegance and reusability, such as declarative configuration or through a configuration API of some sort.</p>
<p>So you see, my point is something like this: &#8220;If you feel the need to do something in a private method, there&#8217;s probably a better way to do it that doesn&#8217;t involve a private method and would allow for greater customization and re-usability/re-purposing of your API  in the field.&#8221;</p>
<p>I&#8217;m not saying &#8220;just make every private method public&#8221; and cluttering up your API, I&#8217;m saying &#8220;design in such a way that you no longer need that private method&#8221;</p>
<p>If you really MUST have something that&#8217;s hidden or private, at least make it PROTECTED and VIRTUAL at that.</p>
<p>Final thought: Your primary goal as an API writer should be to allow consumers of your API to use it to fit their purposes. Providing convenient functionality is #2 priority.  You will NEVER be able to predict how your API will be used in-the-field, so you MUST allow for it to be used in ways you didn&#8217;t expect. This means that you should, to the maximum extent possible, allow consumers to override, extend, and even replace parts of your API.</p>
<p>Using test-driven development (NOT testing after-the-fact, although that still provides some benefit) will help you to design with extensibility and replace-ability in mind.  Using TDD, you necessarily FORCE yourself to think as a user, using your API in different ways than it was originally designed for</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omer Rauchwerger</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-28</link>
		<dc:creator>Omer Rauchwerger</dc:creator>
		<pubDate>Mon, 07 Jan 2008 13:58:14 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-28</guid>
		<description>Chad,

I&#039;m probably wrong about this case, as I&#039;ve never written a public API. 
My objection comes from a world of plain OOD, where I believe encapsulation has and will always have its respected place.

Breaking encapsulation often leads to confusion and later on misuse. If you declare everything public, how can you direct your users to do the right thing? (Really, I would love your advice on this one for a public project I am going to start in a few weeks)

P.S. I still think this will lead to less frequent releases, though.</description>
		<content:encoded><![CDATA[<p>Chad,</p>
<p>I&#8217;m probably wrong about this case, as I&#8217;ve never written a public API.<br />
My objection comes from a world of plain OOD, where I believe encapsulation has and will always have its respected place.</p>
<p>Breaking encapsulation often leads to confusion and later on misuse. If you declare everything public, how can you direct your users to do the right thing? (Really, I would love your advice on this one for a public project I am going to start in a few weeks)</p>
<p>P.S. I still think this will lead to less frequent releases, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chadmyers</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-27</link>
		<dc:creator>chadmyers</dc:creator>
		<pubDate>Mon, 07 Jan 2008 05:36:44 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-27</guid>
		<description>@Omer: I&#039;m no spring chicken, I&#039;ve built several released public API&#039;s myself and every time I&#039;ve done so I always ended up regretting most, if not all the places I made things private/internal.

I&#039;m not familiar with Krzysztof&#039;s book, but if it was used to design things like the SqlClient API in the BCL, then I would advise not using that book as it doesn&#039;t reflect good framework design.

The answer to your &quot;InitializeSQLProps()&quot; problem is not that it should be made private/internal (perhaps protected), but that it should be moved elsewhere. 

I&#039;m starting to think that marking things private/internal on a &gt;PUBLIC&lt; API is a code smell.  

As a public API writer, you can&#039;t POSSIBLY think of all the ways in which your consumers will use your API. So while you may not make InitializeSQLProps public, ALL THE FUNCTIONALITY in that method SHOULD BE PUBLIC ALLY AVAILABLE ELSEWHERE.

The problem is that all to often people make the contents of InitializeSQLProps private/internal and make it a critical-path function for much of the functionality of a given API and any would-be extender or overrider is just plain S.O.L. (as is the case in much of the BCL API).</description>
		<content:encoded><![CDATA[<p>@Omer: I&#8217;m no spring chicken, I&#8217;ve built several released public API&#8217;s myself and every time I&#8217;ve done so I always ended up regretting most, if not all the places I made things private/internal.</p>
<p>I&#8217;m not familiar with Krzysztof&#8217;s book, but if it was used to design things like the SqlClient API in the BCL, then I would advise not using that book as it doesn&#8217;t reflect good framework design.</p>
<p>The answer to your &#8220;InitializeSQLProps()&#8221; problem is not that it should be made private/internal (perhaps protected), but that it should be moved elsewhere. </p>
<p>I&#8217;m starting to think that marking things private/internal on a >PUBLIC< API is a code smell.  </p>
<p>As a public API writer, you can&#8217;t POSSIBLY think of all the ways in which your consumers will use your API. So while you may not make InitializeSQLProps public, ALL THE FUNCTIONALITY in that method SHOULD BE PUBLIC ALLY AVAILABLE ELSEWHERE.</p>
<p>The problem is that all to often people make the contents of InitializeSQLProps private/internal and make it a critical-path function for much of the functionality of a given API and any would-be extender or overrider is just plain S.O.L. (as is the case in much of the BCL API).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omer Rauchwerger</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-26</link>
		<dc:creator>Omer Rauchwerger</dc:creator>
		<pubDate>Mon, 07 Jan 2008 05:17:57 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-26</guid>
		<description>Chad,

There are a many important aspects to encapsulation such as clarity, intent and simplicity. These will all be shattered when releasing frameworks with every method as public.

The user will be extremely confused as he will be presented with an Intellisense box containing thousands of irrelevant methods and wouldn&#039;t be able to use the API as documentation. (I follow Krzysztof Cwalina advice from &quot;Framework Design Guidelines&quot; on this subject)

Besides that, making everything public would require the developers to think of every small private method (InitializeSQLProps()) as a grade A public method that people will use. This means much more time on API design =&gt; less frequent releases.</description>
		<content:encoded><![CDATA[<p>Chad,</p>
<p>There are a many important aspects to encapsulation such as clarity, intent and simplicity. These will all be shattered when releasing frameworks with every method as public.</p>
<p>The user will be extremely confused as he will be presented with an Intellisense box containing thousands of irrelevant methods and wouldn&#8217;t be able to use the API as documentation. (I follow Krzysztof Cwalina advice from &#8220;Framework Design Guidelines&#8221; on this subject)</p>
<p>Besides that, making everything public would require the developers to think of every small private method (InitializeSQLProps()) as a grade A public method that people will use. This means much more time on API design => less frequent releases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chadmyers</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-25</link>
		<dc:creator>chadmyers</dc:creator>
		<pubDate>Mon, 07 Jan 2008 03:36:57 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-25</guid>
		<description>@Steven: shoot, forgot about that post when I posted this. Cheers.

@Omer: Good point, but I guess I would caution making anything private (aside from member fields) unless you absolutely HAVE to. In a framework like ASP.NET MVC, I&#039;m willing to be that almost no methods should be private.

@EbbTide: In the context of building frameworks: Static members are bad because they can&#039;t be mocked easily, they&#039;re usually used for some type of singleton arrangement (think HttpContext.Current) which also undermines and thwarts testing, etc.  Also, they can&#039;t be overloaded or extended (usually) which limits a framework&#039;s re-usability.</description>
		<content:encoded><![CDATA[<p>@Steven: shoot, forgot about that post when I posted this. Cheers.</p>
<p>@Omer: Good point, but I guess I would caution making anything private (aside from member fields) unless you absolutely HAVE to. In a framework like ASP.NET MVC, I&#8217;m willing to be that almost no methods should be private.</p>
<p>@EbbTide: In the context of building frameworks: Static members are bad because they can&#8217;t be mocked easily, they&#8217;re usually used for some type of singleton arrangement (think HttpContext.Current) which also undermines and thwarts testing, etc.  Also, they can&#8217;t be overloaded or extended (usually) which limits a framework&#8217;s re-usability.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EbbTide</title>
		<link>http://lostechies.com/chadmyers/2008/01/06/a-challenge-to-microsoft-scott-guthrie/#comment-24</link>
		<dc:creator>EbbTide</dc:creator>
		<pubDate>Mon, 07 Jan 2008 02:19:46 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/01/06/a-challenge-to-microsoft-scott-guthrie.aspx#comment-24</guid>
		<description>What&#039;s wrong with static members?</description>
		<content:encoded><![CDATA[<p>What&#8217;s wrong with static members?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
