Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Seems like a fundamental problem with the .NET API...</p> </blockquote> <p>I don't know if I'd go that far.</p> <p>Consider almost any collection class in .NET. Chances are it has a <code>Count</code> property that returns an <code>int</code>. So this suggests the class is bounded at a size of <code>int.MaxValue</code> (2147483647). That's not really a <em>problem</em>; it's a <em>limitation</em> -- and a perfectly reasonable one, in the vast majority of scenarios.</p> <p>Anyway, what would the alternative be? There's <code>uint</code> -- but that's not CLS-compliant. Then there's <code>long</code>...</p> <p>What if <code>Length</code> returned a <code>long</code>?</p> <ol> <li>An additional 32 bits of memory would be required anywhere you wanted to know the length of a string.</li> <li>The benefit would be: we could have strings taking up billions of gigabytes of RAM. Hooray.</li> </ol> <p>Try to imagine the mind-boggling cost of some code like this:</p> <pre><code>// Lord knows how many characters string ulysses = GetUlyssesText(); // allocate an entirely new string of roughly equivalent size string schmulysses = ulysses.Replace("Ulysses", "Schmulysses"); </code></pre> <p>Basically, if you're thinking of <code>string</code> as a data structure meant to store an unlimited quantity of text, you've got unrealistic expectations. When it comes to objects of this size, it becomes questionable whether you have any need to hold them in memory at all (as opposed to hard disk).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload