"I can't believe Microsoft didn't make [Enter API Name Here] public"

Jeremy Miller takes a dig at the BCL team with his post, I love Ayende (and OSS):

From one of Ayende's many OSS projects.

/// This class actually already exists in the System.Core assembly...as an internal class.
/// I can only speculate as to why it is internal, but it is obviously much too dangerous
/// for anyone outside of Microsoft to be using... 

And dear MS BCL team, since so many people are already using Reflector to go get the ExpressionVisitor code, would you just make this public?  'K, thx.

This seems like an oversight that this wasn't public in first place. It would just be a couple minutes of a single developer's time to change the accessibility from internal to public, right?

Well, actually, it's a lot more complicated than that. There's very good reasons we don't make things public and virtual by default; Eric Lippert summarizes it pretty well with his post, How many Microsoft employees does it take to change a lightbulb?

  • One dev to spend five minutes implementing ChangeLightBulbWindowHandleEx.
  • One program manager to write the specification.
  • One localization expert to review the specification for localizability issues.
  • One usability expert to review the specification for accessibility and usability issues.
  • At least one dev, tester and PM to brainstorm security vulnerabilities.
  • One PM to add the security model to the specification.
  • One tester to write the test plan.
  • One test lead to update the test schedule.
  • One tester to write the test cases and add them to the nightly automation.
  • Three or four testers to participate in an ad hoc bug bash.
  • One technical writer to write the documentation.
  • One technical reviewer to proofread the documentation.
  • One copy editor to proofread the documentation.
  • One documentation manager to integrate the new documentation into the existing body of text, update tables of contents, indexes, etc.
  • Twenty-five translators to translate the documentation and error messages into all the languages supported by Windows.The managers for the translators live in Ireland (European languages) and Japan (Asian languages), which are both severely time-shifted from Redmond, so dealing with them can be a fairly complex logistical problem.
  • A team of senior managers to coordinate all these people, write the cheques, and justify the costs to their Vice President.

In addition to the excellent reasons that Eric lists (and the one that often gets forgotten) is compatibility. Despite what appears to be evidence to the contrary, the compatibility bar between versions of the Framework is extremely high. Every single public member and type and its behavior needs be maintained indefinitely. The more APIs that are public and/or virtual, the more baggage that needs to be brought forward into future Framework versions so as to not break compatibility.

Developing good APIs is extremely difficult, especially the first time around. When we get things wrong (and we do get things wrong), trying to maintain backwards compatibility often stifles innovation as we try to correct these scenarios. Unfortunately, unlike others, we don't have the luxury to make only 95% of our new versions backwards compatible with our previous versions.

It is for these very reasons, we try to make our extension points deliberate and designed.

Published Tuesday, December 09, 2008 7:00 AM by David Kean

Comments

Tuesday, December 09, 2008 11:04 AM by Chad Myers

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

It's interesting that your first thought while responding to Jeremy and Ayende is to make excuses and defend the problem rather than seeking the solution.

First of all, I should make it pretty clear, I do not work on the BCL team. In fact, I believe this particular API is owned by the Managed Languages team (C# and VB). The only thing I could do to solve this problem is to file a bug internally (just like you can). In fact, it's actually better if someone from the community files it, because its more likely to get fixed.

Instead of making excuses for convoluted process, self-imposed archaic and backwards design rules, and poor design overall, maybe you should be engaging Jeremy and Ayende how they manage their frameworks and how they are able to avoid the kinds of problems in which the Microsoft, BCL/API team(s) seem to keep finding themselves.

Self-imposed? Yes definitely. Archaic and backwards design rules? Somewhat, but as mentioned below by Justin, what are alternatives? Skimp on security testing? We've already done that before and you all know how that turned out. No documentation? That's probably fine for advanced users, like the ALT.NET crowd, but doesn't really fly for everyone else.

Using language like "we don't have the luxury" (which implies that Jeremy or Ayende aren't smart or experienced enough to know the problems with public APIs) is not helpful and is insulting.

Not at all (or my point wasn't to be insulting). I was just referring to the fact that Microsoft has hundreds of thousands of developers using their APIs and millions upon millions of users that are ultimately affected by them. We need to be careful when we make breaking changes, otherwise, Steve Ballmer gets a phone call from the CEO from a very major company asking why the hell the next version of [Product] broke their internal applications, in affect costing them millions of dollars (true story).

The larger point that Jeremy and Ayende are making is that the rather lengthy and complex process you have for releasing APIs may be the problem here and that because Microsoft has such a complex and convoluted process teams are AFRAID of making things public when they really should be.

You have no argument from me regarding this - we're getting better though. Projects like ASP.NET MVC and Managed Extensibility Framework are changing the way we develop and interact with the community. Hopefully, other teams around Microsoft will follow.

It's simply easier to make things private/internal than to think through what might be best for the customer.

Most definitely, but no one at Microsoft deliberately goes out of their way to develop things that are not best for the customer. The problem is determining what is best the customer - that's the hard thing. For example, in MEF, we've spent literally 3 months discussing a particular feature with both internal and external customers (not even a very large feature) and we still can't decide on the correct approach. In these situations it is often better to do nothing (unfortunately, we actually have to choose an approach with this particular feature), and wait until people are actually using the API for real products, and then you quickly see a pattern in the feature requests and common road blocks that they encounter. Then in V2, can you make an informed decision.

Microsoft have chosen their rules on API design and the point is that perhaps these rules are hampering quality software and are a detriment to its users over all.

You seem to be mixing 'quality' with 'functionality'. Don't confuse the two - they are not the same.
> A deteriment to its users over all
Hmmm...okay, let's take the ExpressionVisitor class example from above. How many users to do you actually think overall would actually use this class? Its likely you would use this class when writing an IQueryable provider and a few other select scenarios, but to most users do you think they actually care whether this is public or not? (hell we in MEF parse expressions and we don't use/need this class). If this was you, do you choose to spend (limited) resources on making a few happy, or the majority?

In the effort to protect them from future problems you may be holding them back now.

There's also the larger issue of poor API design that necessitates this type of protectionism mentality.  If the framework and API were designed with IoC, dependency injection, interface segregation principle, and other core design principles in mind versus strict inheritance over composition, the problem that Jeremy and Ayende mention either wouldn't exist, or would have other remedies without having to be fearful and making everything private/internal.

I'm confused how you think IoC and DI solve the above problems - it certainly doesn't solve the resources and compatibility problems.
Tuesday, December 09, 2008 11:08 AM by Chad Myers

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

Follow-up:  I did want to temper my response by saying that the things in your process are necessary and important. We all understand and appreciate that. We also appreciate the quality of the BCL API's in general.

But there are ways of achieving this level of performance without compromising on the design of the API.

When you say "we don't have the luxury," I say: "Why not?"

Perhaps you should say, "We choose not to have the luxury" or "We have created an environment where this sort of change is not reasonable to do" as these are closer to the truth.

Tuesday, December 09, 2008 11:09 AM by Scott Bellware

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

Dave,

All this is saying is that Microsoft's organization is completely screwed and attests to their continuous head-in-the-sand approach to organizational practices like those used at Toyota.

You've done a good job at communicating why the organization can't handle situations like the one Ayende and Jeremy are pointing out, but you haven't offered any insight into why Microsoft can reform itself toward an organization that wasn't hatched in the dark ages of the early industrial revolution.

Tuesday, December 09, 2008 12:08 PM by Colin Jack

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

"It is for these very reasons, we try to make our extension points deliberate and designed."

Here's the problem, if people like Jeremy Miller or Ayende (or any other hard core user of the framework) say that something should be public then you missed a necessary extension point.

Your reasons are fine, but ultimately you should be listening to people in the community on these issues and making changes (adding extension points) to make the experience better.

I have no doubt that this is a missed extension point - the question is how many people will actually benefit from this change (bearing in mind there is already an article that shows how to do this)? Jeremy and Ayende are in the top 5% of users, are these the users we should be targeting? Or should we be targeting the other 95%?
Tuesday, December 09, 2008 12:09 PM by Kevin Miller

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

You are quite correct. Creating APIs is hard. Microsoft has and WILL get it wrong. I think you need to take a moment to introspect on a culture that views change as scary.

I feel that Microsoft's culture of backwards compatibility as a must have is a broken principal. .Net for a long time has included an obsolete tag for a reason. People do make mistakes and better ways are found to do things. We improve ourselves our code and so should the framework.

Tuesday, December 09, 2008 12:10 PM by Richard Wagoner

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

The solution is simple: don't listen to these simple folk. You work for a multi-billion dollar company, obviously you guys are doing things right. Remember, opinions are like assholes, and I hear these ALT.NET people have a lot of those!

Take it from me, the very worst thing you could do is change a process that's worked for you in the past. Oh sure, you'll hear that others are doing things differently and more "efficiently" but that's just their honeymoon phase. Every company goes through that, but you aren't just any other company, you're a great company and far beyond the need to improve on a process proven to work when you had no competition.

Tuesday, December 09, 2008 1:16 PM by Colin Jack

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

I fully understand why you need to be careful about exposing too much (though I would argue that to many of us indefinite backwards compatibility is not something we need) but I still think there is probably a way you can harness the knowledge that these people have about problems using some parts of your framework. So I was wondering whether you have thought about creating a site where people could report missing extensibility points?

Tuesday, December 09, 2008 1:17 PM by Peter Ritchie

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

@Richard.  Seriously? You gauge the net worth of an organization as an indication of whether it's right, wrong, or needs to fix something?  I'm just glad that other industries don't follow that, I'd hate to see Toyota view its dominance and its bank account as the deciding factor whether they should recall something because of a defect.

Tuesday, December 09, 2008 1:19 PM by Chad Myers

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

@Peter: "Richard" was a sarcastic joke (note the link to his name).

While clever, it doesn't help the discussion and distracts from good discourse.

Tuesday, December 09, 2008 2:01 PM by NotMyself

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

RABBLE RABBLE RABBLE

Tuesday, December 09, 2008 2:32 PM by Ayende @ Rahien

# Consenting Adults

Consenting Adults

Tuesday, December 09, 2008 4:46 PM by Justin Rudd

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

(Disclaimer: I work for Microsoft)

Looking at the list of archaic reasons, I wonder which ones people would like dropped?  If the security review was dropped and a security vulnerability found, people would scream.

Localization?  Sorry you guys in Germany, docs are English only.

Proof-reading?  Alright, this *might* could be dropped.  But then the public would laugh at our run on sentences or fragments.

Some of the bureaucracy (25 managers, 2 VPs, etc.) could probably be streamlined.  But that's well above my pay grade...

I guess I don't see how the process he mentions is convoluted or archaic.  It is the process of a global company that has been dogged in the past because of security vulnerabilities.

Now with respect to backward compatibility and api design...

When everything was C based, it made sense.  You didn't want people to have to recompile to run their Windows 95 apps on Windows 98 (or NT).

But I thought one of the goals of the .NET Framework was side by side execution?  I.e. if .NET 4.0 removed an API, just ship with 3.5 and make sure your assembly bindings are correct.  If you really want that 4.0 API, then you gotta deal with the missing API.

Side-by-side helps somewhat, but doesn't solve all the problems. For example, .NET 1.0 is not longer supported - what happens to those companies that want to move to .NET 3.5 so that they can run on Vista? If they contracted someone to original develop their application, then you want them to be able to move to the latest version via config switch, without requiring them to pay a bunch of money to fix all the problems.

Breaking backward compatibility in .NET 4.0 is probably much easier than breaking...say...Kernel32.dll.

As for API design, I personally like the Java approach that everything is virtual.  I think we should stop treating developers like children.  Maybe we should publish our test cases and say "caveat emptor if you use beyond these test cases".

I do find it interesting that DI and IoC were brought up.  .NET came out in July 2000?  I'm sure there were pockets of people living the DI/TDD lifestyle, but it really didn't hit mainstream until 2003 (granted I was in Java world at the time and Spring had just been released. Pico was out, but didn't have the momentum that Spring got).  Microsoft couldn't divine that it was going to be so big.

But that brings us back to breaking backward compatibility, side by side execution, yada, yada, yada.

Tuesday, December 09, 2008 5:05 PM by Bunter

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

Sounds like it will still take time for the mentality shift towards approaches like their asp.net mvc is being developed. Instead of doing "behold, this is our new all-mighty product" to beta testers and then release it to production they might try more incremental beta releases to wider community.

Tuesday, December 09, 2008 5:15 PM by ToRemainAnonymous

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

Well, Ayende's code is hard to find, sometimes doesn't build, has had dependencies all over the place - isn't document - typically is left unfinished with alot of fanfare when it starts.

I like Ayende, but let's not crown him yet Chad - I see it as an assortment of code he used to solve his problem then openly shared - left for you to figure it all out.

I would suspect that MS can't just throw things together like that and modify it 'whenever'.

I also would suggest you haven't even come close to writing an API used by as many people as MS  :)

Tuesday, December 09, 2008 10:59 PM by Jeff Handley

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

David,

I posted a article on my blog on this subject.  Why Public Virtual Ubiquity Would Fail.

jeffhandley.com/.../why-public-virtual-ubiquity-would-fail.aspx

Jeff Handley

Wednesday, December 10, 2008 12:40 AM by Colin Jack

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

"Or should we be targeting the other 95%?"

The truth is most of us now use a lot of open source tools and rely on them, I'm not saying its an easy decision but I do think you should be considering how to make it easier to add extensibility points.

Wednesday, December 10, 2008 12:52 AM by Frans Bouma

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

@Chad: Oren isn't the main developer of nhibernate. He did/does a lot of work for it but Fabio does way more. Using Oren as an example how he manages his framework is IMHO not giving credit to the right people.

Wednesday, December 10, 2008 12:52 AM by Sidar Ok

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

Dave,

>> Developing good APIs is extremely difficult, especially the first time around. When we get things wrong (and we do get things wrong), trying to maintain backwards compatibility often stifles innovation as we try to correct these scenarios. Unfortunately, unlike others, we don't have the luxury to make only 95% of our new versions backwards compatible with our previous versions.

From this paragraph I can tell that you didn't do any assessments of breaking changes over the past products of Microsoft, and that sentence to the reference is both insulting and misleading.

Don't go too far, just look at the list of breaking changes from 1.0 to 1.1 and 1.1 to 2.0 .

I don't mean to imply that we don't make breaking changes, however, we do so, only as a last resort. These are not the typical though, only a very tiny percentage of APIs are actually affected. For example, we don't make breaking changes to clean 'a lot of crap up and [to make up] for a better user experience'. For breaking changes guidelines that all libraries within the .NET Framework must follow, see the Word document available in this package: http://download.microsoft.com/download/1/1/8/1183f0bb-2939-484d-9009-36c42100875e/breakingchanges.exe

If not enough, go to compact framework forums

When I'm talking about the Framework, I'm talking about the Desktop Framework. My group doesn't own the breaking changes in Compact Framework, so I'm not qualified to talk about them. That may sound like a cop out - but Compact Framework is a completely different team to the .NET Framework.

Ah, are these too old ? Wait for the new EF 2.0   and watch Microsoft touching that 100% ceiling. So for WWF.  

These new versions haven't been released, any breaking changes they will make will need to go through and get improved by the breaking change committee.

Not even mentioning the projects that are dropped and couldn't even reach to the point to be represented by a percentage sign.

As a customer, I want the platform that I consume to be more suiting my needs. Am I unreasonable? Sorry, but I don't care how long it will take because of 2 things :

1 - I am a customer.

2 - The issue causing this is by (bad) design, and the former point also states that I was not the one who did it, so why am I paying the bill ?

I hope this is not the general perspective in Microsoft since there will be no major improvements and shows that everybody is afraid of introducing better things, just because it takes a lot of time and hassle.

You seem to be misinterpreting what I was talking about - I'm saying that we can innovate and improve broken scenarios today because we favor private and non-virtual over public and virtual. If we released every type as public and every method as virtual, we wouldn't be able to make the changes we can today.
Wednesday, December 10, 2008 10:14 AM by Adam Hill

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

To be fair there are groups at MS that are not afraid to break backward compatibility for good reasons.

The WPF team is going to no-op the BitmapEffect API since they have introduced real a real HW Shader API, probably for perf reasons. I for one am glad they are doing this, but I wish they had provided drop-in replacements for OuterGlow and remembered to make VisualEffect public for ContainerVisuals. (See - social.msdn.microsoft.com/.../12fbdc6d-0850-4379-b357-bc8a0abc03f3)

API XXX is Dead! Long Lve API XXX!

Wednesday, December 10, 2008 7:07 PM by gOODiDEA.NET

# Interesting Finds: 2008.12.08~2008.12.11

Web 3 reasons why you should let Google host jQuery for you 链接A引发的思考 YUI Library, YUI Doc, and Github

Wednesday, December 10, 2008 10:44 PM by Bunter

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

"You seem to be misinterpreting what I was talking about - I'm saying that we can innovate and improve broken scenarios today because we favor private and non-virtual over public and virtual." - so basically Microsoft can improve things internally, make bugfixes but customers to whom .NET framework is actually targeted at, are stuck with badly designed, "very hard to get it right at the first time" public API? To whom are you producing .NET in a first place?

We can improve things internally and externally, and not just bugfixes. Once an API has been used in the wild, it's very easy to guage dissatisfiers and needed extension points.
Thursday, December 11, 2008 8:01 AM by Chad Myers

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

@Frans: I didn't say he was the primary on NHibernate. He does have other frameworks, you know (Rhino Mocks, he does a lot of Windsor stuff, etc).

Thursday, December 11, 2008 8:57 AM by John P. Brice

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

HAHAHA

I love it when a certain 'group' of people have all the answers and once again we're back to Microsoft is just stupid and despite and a zillion dollars don't know how to write/design software, but a handful of isolationist who work in silo's with the top 5% of development community know exactly what Microsoft should be doing differently (they're probably former Sun supporters and were telling Sun how to make Java a product that would be used by all).

There's a reason you isolationist are considered that way and your 'groups' are mocked behind your backs - because you live in a fricken Ivory Tower!   Get off your high horse!  All those thousands of people at Microsoft - many who run circles around you in formal education, experience, or both - they don't know what they're doing right?

In fact, why don't you all go to work for DoD for 6 months and come back and tell me if you feel the same about making everything public/internal/overridable for YOUR benifit and YOUR ease of use in YOUR testing framework.  Oh, but wait, you'll probably just tell them they're wrong too right?   Cause everybody has it wrong except for you right?  There's nothing you possibly could be over-zealous about or idealogical about right?   The whole fricken world has a problem and you have all the answers!

Or maybe your just bitter that the company who provides you enough work to make a rather large salary from didn't hire you directly or value some random input you made in the past or turned down your resume.  Since Microsoft has so many core design problems in it's framework, in it's OS, in security, it's browser, why don't you go work for Google in Java - I'm sure everything is public in Java - or no, go do PHP applciations for a living - PHP is 100% testable right?  Or no - go do some Ruby somewhere then.  

Quit your belly aching or go work in a world where these problems don't exist or people want to actually hear your suggestions because the fact is we're sick of hearing it.

Saturday, December 13, 2008 2:24 PM by Rob Kitson

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

@John Who is "We"?  Speak for yourself.

I, for one, am glad "we" have a concerned group of talented people that are willing to voice their concerns with the powers that be.  The fact that many of these people have either authored, or made significant contributions to, projects which are helpful to the community as a whole says a lot about their commitment to the betterment of the .Net development ecosystem.  And if you look at many of those projects, you'll find that they exist to make our jobs easier and make our work more maintainable.  

Friday, December 19, 2008 1:26 PM by Dave's Box

# Moving a type from one assembly to another using TypeForwardedToAttribute

One of the problems that we’re facing today in the Framework, mainly stemming from the red bits

Friday, January 02, 2009 1:14 PM by developingchris

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

maybe we should weld the hoods of cars shut because most drivers are not mechanics.

Tuesday, May 26, 2009 9:00 AM by Karl Seguin

# re: "I can't believe Microsoft didn't make [Enter API Name Here] public"

Almost two years ago, to the day, I completely gave up on Silverlight. How do I remember the day so clearly