Rob Chartier ~ Contemplation...

.NET, C#, Work, etc.

News






www.flickr.com
This is a Flickr badge showing public photos from Rob & Kat Chartier. Make your own badge here.


Even Quicker Links

Longest & Shortest Types in .NET

Junfeng Zhang asks what is the longest class name in .NET.  I threw together a quick little .NET class digger and found that:

From the assemblies located at: “..\v1.1.4322\System*.dll"

C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll

Contains the type:

UpDownBase+UpDownButtons+UpDownButtonsAccessibleObject+DirectionButtonAccessibleObject

which is 86 characters long.

The shortest:

C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Design.dll

Contains:

System.Design.SR

which is, of course, a length of 2

 

EDIT:

To add, the longest PUBLIC class is:

System.Windows.Forms.IDataGridColumnStyleEditingNotificationService

with a length of 46

 

Posted: Feb 05 2004, 05:33 PM by Rob Chartier | with 9 comment(s)
Filed under:

Comments

Junfeng Zhang said:

Thanks for the quick dig.

Yes, not out of my expectation.
# February 5, 2004 10:53 PM

TrackBack said:

# February 5, 2004 11:38 PM

TrackBack said:

Inspired indirectly by my post about the longest class name in J2SE, Rob Chartier looked for the longest and shortest type names in .NET Looks like he includes the .NET equivalents of package names and nested class names, and...
# February 6, 2004 2:49 AM

Mark Hurd said:

Note to your EDIT: System.GC is the shortest public class name.

Using DotLisp and my extra.lisp patch: (Not all system assemblies loaded)

> (for-each-type t (when (and t.IsPublic (<= t.Name.Length 3)) (prns t.FullName)))
System.GC
System.Security.Cryptography.DES
System.Security.Cryptography.DSA
System.Security.Cryptography.MD5
System.Security.Cryptography.RC2
System.Security.Cryptography.RSA
System.Security.Policy.Url
System.Uri
System.Net.Dns
System.Windows.Forms.Day
System.Drawing.Pen

> (for-each-type t (when (and t.IsPublic (>= t.Name.Length 39)) (prns t.FullName)))
System.Security.Cryptography.CryptographicUnexpectedOperationException
System.Security.Policy.ApplicationDirectoryMembershipCondition
System.CodeDom.CodeParameterDeclarationExpressionCollection
System.CodeDom.CodePropertySetValueReferenceExpression
System.ComponentModel.DesignerSerializationVisibilityAttribute
System.Diagnostics.PerformanceCounterPermissionEntryCollection
System.Windows.Forms.IDataGridColumnStyleEditingNotificationService
System.Windows.Forms.DataGridPreferredColumnWidthTypeConverter
System.Xml.Serialization.XmlSerializationCollectionFixupCallback
>
# February 26, 2004 12:09 AM

Mark Hurd said:

David Flanagan: If you're looking at full names for PUBLIC classes

System.GC

is shortest at 9, and

System.Windows.Forms.ComponentModel.Com2Interop.ICom2PropertyPageDisplayService

is longest at 79.

Again, using DotLisp:

> (for-each-type t (when (and t.IsPublic (<= t.FullName.Length 11)) (prns t.FullName)))
System.Enum
System.Byte
System.Char
System.GC
System.Guid
System.Math
System.Type
System.Void
System.Uri
> (for-each-type t (when (and t.IsPublic (>= t.FullName.Length 69)) (prns t.FullName)))
System.Security.Cryptography.CryptographicUnexpectedOperationException
System.ComponentModel.Design.Serialization.DesignerSerializerAttribute
System.ComponentModel.Design.Serialization.IDesignerSerializationManager
System.ComponentModel.Design.Serialization.IDesignerSerializationProvider
System.ComponentModel.Design.Serialization.IDesignerSerializationService
System.ComponentModel.Design.Serialization.RootDesignerSerializerAttribute
System.Security.Cryptography.X509Certificates.X509CertificateCollection
System.Windows.Forms.ComponentModel.Com2Interop.ICom2PropertyPageDisplayService
# February 26, 2004 12:14 AM

Karl Seguin [MVP] said:

This is as useless as useless posts go but.... I happen to be on MSDN the other day (via Google) and

# August 1, 2007 8:32 PM

home security tip said:

If you feel disheartened because of the dreadful amount of effort it requires to hit upon what you are searching for, relax because you are one step closer to your goal.

# August 4, 2007 1:03 AM

And the longest JRE class name is... said:

Pingback from  And the longest JRE class name is...

# November 7, 2007 1:58 PM

Hungarian notation pros vs cons | keyongtech said:

Pingback from  Hungarian notation pros vs cons | keyongtech

# January 22, 2009 12:33 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)