This is one of my major cribs that i had let settle down for peace of mind a long time back. but then it had risen up when i saw the exact same question in a forum today. Here is the teaser design riddle.
It seems really really odd on seeing the inheritance chain of some of the classes in the System.IO namespace. If you notice, the StreamReader derives from TextReader and StreamWriter from TextWriter. Why is that ?? Typically a stream is a generalised entity and looking from a pure object oriented perspective, the textreader should be the subtype of the streamreader and not the other way around.
Well say that the framework designers had some valid design reason to do that, then why is that the stream serves as the base for all the other streams like FileStream, MemoryStream and BufferedStream ??
hmm .. the major irony is still to come .. Check the XmlTextReader class.. Now according to the synonymity in the name between textreader and xmltextreader, the developer is deceived in assuming that XmlTextReader is the base for XmlReader which is very similar again to the StreamReader ! Well don't hope too much because in reality it is the inverse and the XmlTextReader is the sub type of XmlReader !
I am still grappling to find out the reason for such an implementation ! I have asked in several forums about this but then no one has been able to provide a valid reason ! If someone here or from the microsoft framework design team can enlighten us with the reason then it would be really really helpful !