Compartilhar via


Number of Types in the .NET Framework

Occasionally I get asked how big the .NET Framework is in terms of surface area for developers.  As you might guess this is something we track.  As you can see, in each release we are adding new functionality that make it easier to build .NET applications.    The number of types in the .NET Framework is 11,417!  Any guesses on how many types will be in .NET Framework 4.0?

 

image     image

 

image        image

 

   
   

Comments

  • Anonymous
    March 17, 2008
    PingBack from http://blueonionsoftware.com/Blog.aspx?p=911586bb-6ea3-43a4-b1f6-00706e92adcf

  • Anonymous
    March 17, 2008
    The comment has been removed

  • Anonymous
    March 17, 2008
    ASP.NET, Web Evítate problemas: pon SIEMPRE un nombre de aplicación en Web.config . Una recomendación

  • Anonymous
    March 17, 2008
    Sorry are these public only? (relevant to surface area for users rather than BCL developers. I really should whip up a treegridview of this by names space...

  • Anonymous
    March 17, 2008
    Who ever said more types == easier to program?

  • Anonymous
    March 17, 2008
    Mike you are not required to use all that types, you chose ones that meets your requrements, perhaps I think it is better to have choise.

  • Anonymous
    March 17, 2008
    So when is .net framework 4.0 coming along?

  • Anonymous
    March 17, 2008
    The large number of types is why our code reviews focus on reducing the number of different .NET framework calls our applications use.  More framework calls means larger likelihood of bugs in existing applications and when the framework is upgraded.   It would help us greatly for the MS compilers to emit a map file, a cross reference file, etc that we can process using simple scripting tools (e.g., Findstr) to find these type of problems.  The VS class browser is nice but it is not something we can put into an automated build. Reflection, for example, is scrutinized heavily since we've experienced it being used for a number of bad programming practices (e.g., A consultant not concerned with maintenance costs built a large data model and then recursing its object hierarchy to generate a report instead of just writing the report from the original database data. (Apparently, it was resume driven development or turn in and forget about your semester project))

  • Anonymous
    March 17, 2008
    Each new library has a mandatory lifetime of 3-5 years? or is that just speculation? This might be one reason for the exponential appearance of the complexity curves above.

  • Anonymous
    March 17, 2008
    That's some good information. But as Mike says, I doubt if we have numerous classes there might be a learning curve. Anyways having too many things implemented eases life for lazy developers.. ;-)

  • Anonymous
    March 17, 2008
    thank Brad for information

  • Anonymous
    March 17, 2008
    As per trend analysis Assemblies    y = 15.1x + 17.3     108 Namespace   y = 51.6x + 51      361 Types    y = 2249.3x + 626.9    14123 Members   y = 21343x + 7951.3    136009

  • Anonymous
    March 17, 2008
    I wonder if there would be a break point at which a bifurcation would accure and split the .NET framework into two or more than two branches. I do not know what would they call it but this is my guess. As the monolithic systems become too big there is tendency of heirarchy etc etc. (When heirarchies become too big they become monolithic and this cycle goes on and on) (Just like C# classes) Josh Coswell http://riverasp.net

  • Anonymous
    March 17, 2008
    Well I think we may see .NET 4.0 in 2 years time from now. Types - 12,500 odd.

  • Anonymous
    March 17, 2008
    @Josh I believe they are already doing this. Red bits & Green bits. Not a split as you allude, but a core with extensions. From my understanding its pretty much 'someones going to die' before a red bit is changed now-a-days.

  • Anonymous
    March 17, 2008
    Design is finished when there is nothing left to remove. It looks like there is a lot of work to be done ;-)

  • Anonymous
    March 17, 2008
    mmm, are MS planning to release some GOOD doc, instead of MSDN, which is totally unuseful ? It would be appreciable...

  • Anonymous
    March 17, 2008
    We would probably end up with multiple editions of framework like .NET Lite, .NET Mobile, .NET Server, .NET Regular etc. Or may be in other dimention, .NET Desktop, .NET Enterprise Server, .NET Web Server etc..

  • Anonymous
    March 17, 2008
    David .. The MSDN is realy great.. just read it. it's very useful. but MS always have this mesg " The Program encountered a problem & need to close " :-( Hope it would be fixed one day.. I Realy wonder how .NET 4.0 going to be ... it sure will help more & will be easier..

  • Anonymous
    March 17, 2008
    More types==more .NET funcionalities==less work for programmers==more productivity==more end software funcionalities. Thanks.

  • Anonymous
    March 17, 2008
    Adding new functionality is good. But killing old functionality is even better. Who needs ArrayList anymore? Who needs File.ReadAllLines if it could be implemented by an extension method and put into separate assembly which i wont ever use.

  • Anonymous
    March 17, 2008
    The comment has been removed

  • Anonymous
    March 18, 2008
    Was this a personal investigation, or part of a larger MS code review? If the latter, it would be interesting to hear about it. Come to think of it, I haven't heard any rumours about .NET 4 - care to give any hints? (Or are you guys only just starting to think about it now that .NET 3.5 has been released). With regards code reviews, any comments on the increasing proportion of .NET surface area that isn't available to us (ie, internal)? My brief analysis: http://www.feedghost.com/Blogs/BlogEntry.aspx?EntryId=17806 Hopefully I haven't come across as too negative - the .NET framework is a fantastic achievement - so thanks for making my coding life more pleasant! Stu

  • Anonymous
    March 18, 2008
    Re: Eric Compatibility is the main thing that slows any progress. If you need to open an old project you will definitely open it in an old version of Visual Studio and continue using an old version of .NET FW. If thing are never removed every framework becomes a monster. AFAIK .NET 1.1 is not supported on Vista. How would you you explain your customer why he must install a 100 Mb library instead of 20 Mb for compatibility reasons?

  • Anonymous
    March 18, 2008
    The comment has been removed

  • Anonymous
    March 18, 2008
    Brad Abrams just did a post on the Number of Types in the .NET Framework . Here are the results I obtained

  • Anonymous
    March 18, 2008
    Is the source code for .NET 2.0 available yet?  If so, where?  MSDN is nice, but the only completely accurate documentation is the source code.

  • Anonymous
    March 18, 2008
    Have a glance here where I show what NDepend has to say in terms of metrics and dependencies when analyzing the entire .NET Fx3.5: http://codebetter.com/blogs/patricksmacchia/archive/2008/03/18/number-of-types-in-the-net-framework.aspx #assemblies:  119 #namespaces:  933 (here there are some duplication across assemblies, i.e the namespace System for example will be counted as 21  because it is defined in 21 assemblies) #types:  39 509 #methods:  384 300 #fields:  240 070 #IL instructions:  8 562 828  (equivalent to around 1.7M lines of C# or VB.NET code) SELECT METHODS WHERE NbILInstructions > 0:   341 842 SELECT TYPES WHERE IsClass:  29 345 SELECT TYPES WHERE IsStructure:   2 794 SELECT TYPES WHERE IsEnumeration:  4 506 SELECT TYPES WHERE IsDelegate:  1 312 SELECT TYPES WHERE IsInterface:  2 864 SELECT TYPES WHERE IsClass AND IsAbstract:  1 813 SELECT TYPES WHERE DeriveFrom "System.Exception":  633  (DeriveFrom means derives directly and indirectly) SELECT TYPES WHERE DeriveFrom "System.Attribute":  728 SELECT FIELDS WHERE !IsStatic:  103 349 SELECT FIELDS WHERE IsStatic AND !IsEnumValue AND !IsLiteral AND !IsGeneratedByCompiler:  22 783

  • Anonymous
    March 18, 2008
    The comment has been removed

  • Anonymous
    March 18, 2008
    Brian,   It would seem that no good dead goes un-appreciated.  I and many others appreciate your taking the time to share your metrics with us.

  • Anonymous
    March 18, 2008
    errr...that was meant to be "good deed".

  • Anonymous
    March 18, 2008
    "you are not required to use all that types, you chose ones that meets your requrements, perhaps I think it is better to have choise." Of course, but to make an informed choice one must know about all the possible things to choose from.

  • Anonymous
    March 18, 2008
    The comment has been removed

  • Anonymous
    March 18, 2008
    if (dotnetcompiler) {   using(JavaServer vmachine = new JavaServer())  {    vmachine.Impersonate(dotnet, "C#");    objMachCode = vmachine.Compile();    vmachine.Launch(objMachCode);      } }

  • Anonymous
    March 18, 2008
    @Phil: Who's Brian? :) Brad, thanks for the metrics.  I too see each successive release as making it easier to build an application that has much greater functionalitly with less written code from the developer.  The only caveat there is that it requires even more study of the framework itself with each release in order to gain a good understanding of what you can accomplish with it.

  • Anonymous
    March 18, 2008
    What are you planning for .net 4.0? When will it be released?

  • Anonymous
    March 18, 2008
    That is why you fail, Padawan. Master Occam has much to teach you.

  • Anonymous
    March 18, 2008
    Can we say "bloat", boys and girls? You clowns have no idea what you're doing.  This is  precisely the same rathole that Taligent went down.  By trying to put everything you can imagine in the library code, you make it easier to just write your own widget than look for it in the multitude  of .NOT classes.

  • Anonymous
    March 18, 2008
    I hope .net 4.0 will be design for good performance.

  • Anonymous
    March 18, 2008
    As anyone who has ever tried to find docs on MSDN already knows, the .NET Framework is big. Real big.

  • Anonymous
    March 18, 2008
    You're right.  The Java docs are so much better... Just look! http://java.sun.com/j2se/1.4.2/docs/api/index.html Oh, wait... was that sarcasm?

  • Anonymous
    March 18, 2008
    The comment has been removed

  • Anonymous
    March 18, 2008
    Intergenite Andrew Tokeley recently blogged about how a Microsoft developer has to know so much more

  • Anonymous
    March 19, 2008
    I am impressed by the buzz done around my last post on Number of Types in the .NET Framework . Actually

  • Anonymous
    March 19, 2008
    概述本期共有10篇推荐文章,由于忙着写Silverlight2系列,所以导读写的不多,都是三言两语带过,希望大家见谅。1.CreatingaCustomSkinforSilverlig...

  • Anonymous
    March 19, 2008
    Recently Brad Abrams wrote a blog post about the number of types in the NET framework with some general

  • Anonymous
    March 19, 2008
    The comment has been removed

  • Anonymous
    March 19, 2008
    概述 本期共有10篇推荐文章,由于忙着写Silverlight2系列,所以导读写的不多,都是三言两语带过,希望大家见谅。 1.CreatingaCustomSkinforSilverl...

  • Anonymous
    March 19, 2008
    The comment has been removed

  • Anonymous
    March 20, 2008
    More type =>> dummies can program =>> less $ for everybody.  

  • Anonymous
    March 20, 2008
    The comment has been removed

  • Anonymous
    March 21, 2008
    Két érdekes linket szeretnék megosztani. Mindekettő a Framewrok terjedelmességét hivatott bizonyítani

  • Anonymous
    March 21, 2008
    More design is usually not good design.

  • Anonymous
    March 21, 2008
    .Net is like a capitalist economy, if it doesn't grow then the media will deem it to be in trouble.   Shrinking economies are said to be in recession, IMO a shrinking software library would be a thing of beauty. Regarding backward compatibility (eg ArrayList) - why not allow multiple versions of the same library to be incorporated into code - thus System.Collections.1 would contain ArrayList whilst System.Collections.2 would not.

  • Anonymous
    March 26, 2008
    Ditemi quali classi usate e vi dir

  • Anonymous
    March 29, 2008
    Thought I would bring this back again and see if it was popular or not this time around. So many things

  • Anonymous
    April 03, 2008
    Leidsin väga huvitava postituse Brad Abramsi blogist, kus on visuaalsed graafikud selle kohta, kuidas

  • Anonymous
    April 07, 2008
    概述 本期共有10篇推荐文章,由于忙着写Silverlight2系列,所以导读写的不多,都是三言两语带过,希望大家见谅。 1.CreatingaCustomSkinforSilverl...

  • Anonymous
    May 05, 2008
    excellent :) well i will not crib about how good or bad this is ... but must say the info is really interesting ... never thought about that though

  • Anonymous
    May 20, 2008
    The comment has been removed

  • Anonymous
    July 21, 2008
    本期共有10篇推荐文章,由于忙着写Silverlight2系列,所以导读写的不多,都是三言两语带过,希望大家见谅。 1.CreatingaCustomSkinforSilverlight...

  • Anonymous
    September 09, 2008
    There was a question today on how many types are there in the .NET framework and I remembered reading

  • Anonymous
    November 19, 2008
    Your Story is Submitted - Trackback from DotNetShoutout