Speeding up DCD in big projects

Steven Schveighoffer schveiguy at gmail.com
Tue Jul 21 19:25:21 UTC 2020


On 7/21/20 3:03 PM, H. S. Teoh wrote:
> On Tue, Jul 21, 2020 at 10:32:39AM -0700, H. S. Teoh via Digitalmars-d wrote:
> [...]
>> Which also begs the question, *why* does it even throw in the first
>> place.  The non-existence of a file is a normally-expected outcome of
>> isFile/isDir, throwing in that case seems excessively heavy-handed.
>> It's probably a case of bad API design.
> [...]
> 
> There is the workaround of writing:
> 
> 	if (f.exists && f.isDir) ...
> 
> but it's ugly and involves an extra unnecessary syscall roundtrip.
> 
> Basically, this kind of API design is just hideous. I propose we remove
> the throw from isDir/isFile.

We'd probably need a different name. Unfortunately.

-Steve


More information about the Digitalmars-d mailing list