Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • Another compelling factor IMO is having compiled assemblies supporting strings as metadata embedded in the intermediate language (e.g. Attributes); in addition to other low-level CLR features which needed to handle strings beyond simply storing them - for example, interop with native DLLs. Commented Feb 20, 2024 at 19:43
  • i dunno, I was fully expecting the answer to be "because C did it" but tracking down these design descisions is next to impossible unless you find someones biography or off hand blog comment "when we we designing the... joe though x would be great!"" kind of thing Commented Feb 20, 2024 at 19:48
  • 1
    To be honest, I think they allow string because it is such a common type. Why press the "shift" key 140 times an hour? Sure, Intellisense can turn "string" into "String", but I find Intellisense works better if you match the letter case of the type. And from my experience, people don't use Intellisense efficiently, opting to press the Shift key when they don't really need to. But this is pure conjecture. Commented Feb 20, 2024 at 20:01
  • 3
    If the question is actually "what is the history of the string type in .NET?" that is straightforward to answer. The .NET type system is an extension of the Visual Basic type system. The OLE Automation layer which defined interoperability between objects pre .NET was created by the VB team, in the office next to mine in the 1990s. Commented Feb 21, 2024 at 0:47
  • 2
    Behind the scenes .NET strings are morally BSTRs -- basic strings -- with some .NET pixie dust sprinkled on them. Length-prefixed, null-terminated, UTF 16 arrays. Commented Feb 21, 2024 at 0:47