“Beginners to the .NET Framework sometimes have a hard time trying to understand the classes in the System.IO namespace for performing input/output (IO) operations. The difficulty stems from the fact that this namespace is relatively large, containing more than 40 members, some of which are similar classes that can be used to achieve the same tasks. Thus it is sometimes hard to figure out which class is best for which task. This article tries to make your life a bit easier by grouping IO tasks into three categories and introducing the classes that are suitable for each task category.” Read the developer’s article at O’Reilly.
C# Input/Output Classes Simplified
2002-08-06 General Development 4 Comments
Tickle me impressed. The Path class was very interesting, and something I haven’t seen out of Microsoft in the past: an eye for portability. Path resolution seems to be one of the major snafus hindering cross-platform Windows/*IX applications, and Microsoft seems to have made a valiant attempt to resolve it.
Just a simple rip-off of the OpenStep API (from 1994) ! Just take a look at the methods of the NSString and NSFileMangager classes !
Microsoft, I’m soooooo impressed …
I thought of the exact same thing.
I agree with the article on most points, but I think the author forgot some very important items:
– Type-safe Enums
– The ability to allocate Objects on the stack, with one compiler restriction: a stack reference cannot appear in a ‘return’ statement. This improves speed and flexibility and simplifies garbage collectors.
– collections could use a foreach keyword for iteration.
– add a ‘using’ keyword to the foreach that allows the programmer to specify a sorting criteria function. (call me lasy)
– someone else mentioned this: NSSelector… basicly type-safe function pointers. A Delegator as known in WFC.