Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Microsoft did not seal it because sometimes you might want to create a class that has a friendlier name

I expect multiple-language support may have been a stumbling block here but compromising your API (instead of sealing the class, document it as "you shouldn't subclass this") for something that could be done with type aliasing seems like a really bad trade-off. Is the C# using keyword a johnny come lately, or would it not support this functionality?



Yep:

using MyList = List<MyThing>;

The only limitation is that you can't alias generic types, just fully instantiated ones.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: