B
beutler
Recently, I tried to extent class string (it could have much more
features), and ups - "cannot derive from sealed class string", so I
looked around in some groups, and, yes, I found every time the comment
that classes string and even sytem.text.stringbuilders ARE sealed.
While I can understand this for class string (it is a non-modificable,
immutuable string), I was very suprised as I see this for class
stringbuilder.
Of couse, performance optimization is one thing, but how the hell I
could extent string funcionality of .NET ? Write a wrapper class and
forward all methods or what ? That would have to do nothing with
object-orientation, and, when learning a new language, I would not
make two steps backward in design questions...
Sorry, but this is my first contact with C# (I'm coming from C++), and
I'm already shocked. I'm excited what other surprises C# would bring
for me
So please tell me, are there any further reasons why they don't allow
to inherit from both classes, are there any other similar classes or
proposals to extent string functionality in an OO way ?
features), and ups - "cannot derive from sealed class string", so I
looked around in some groups, and, yes, I found every time the comment
that classes string and even sytem.text.stringbuilders ARE sealed.
While I can understand this for class string (it is a non-modificable,
immutuable string), I was very suprised as I see this for class
stringbuilder.
Of couse, performance optimization is one thing, but how the hell I
could extent string funcionality of .NET ? Write a wrapper class and
forward all methods or what ? That would have to do nothing with
object-orientation, and, when learning a new language, I would not
make two steps backward in design questions...
Sorry, but this is my first contact with C# (I'm coming from C++), and
I'm already shocked. I'm excited what other surprises C# would bring
for me
So please tell me, are there any further reasons why they don't allow
to inherit from both classes, are there any other similar classes or
proposals to extent string functionality in an OO way ?