why can't I inherit from StringBuilder?

C

Chris LaJoie

As far as I can tell, there's no logical reason for making this class
sealed. Anyone know why MS decided to do it this way?

Chris
 
W

William Ryan

Typically when they do this it has to do with behind the scenes
optimizations...I can't say this is it for sure, but it does tend to be the
case in many instances.
 
J

Jon Skeet [C# MVP]

Chris LaJoie said:
As far as I can tell, there's no logical reason for making this class
sealed. Anyone know why MS decided to do it this way?

For one thing it means the framework is able to do clever optimisations
internally which it might not be able to do if you were to supply your
own StringBuilder derivation. Just a guess though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top