Closed EskeRahn closed 3 years ago
Is there any scenario where Open
method lacks something and introducing the new ctor
would allow for that?
Is there any scenario where
Open
method lacks something and introducing the newctor
would allow for that?
No, AFAIK, it is purely a cosmetic issue, of having the code/interface look cleaner.
it is purely a cosmetic issue
I am sorry but we don't add new APIs to address cosmetic issues. One reason is code size (every new API increases the code size and we do care about keeping it as small as possible), another is the ease of learning (the more APIs the harder it is to learn all of them and choose which one to use). Thank you!
Background and Motivation
Opening a ZipArchive with a stream and a file today looks oddly different
I would suggest to add a constructor using a filename
Similar to the existing stream constructor
With the same function as the current syntax
I would like to propose this overlay:
Proposed API
Usage Examples
Alternative Designs
Of course the old Open method syntax should be kept for compatibility, and could even be supplemented with a stream variant.
Risks
It would make no functional difference, but would give a more 'clean' interface, similar to how e.g. StreamReader are accepting either a name or a stream.
Remarks
Suggested label: area-System.IO.Compression