Tech Off Post

Single Post Permalink

View Thread: Why are string types immutable in C#?
  • User profile image

    dang I don't have time right now but....

    all of you are close but missing a few things:

    1)  in C strings lead to buffer overruns that create very ugly bugs.

    2)  allocating memory on the fly form the OS slows performance.

    and a few other details like the ones mentiuoned...

    but with the Managed model problems 1 and 2 are the big ones.

    #1 can't happen in managed code. (well as far as I know it can't)

    #2 is greatly reduced.

    thats why in a nutshell.