is "import std;" a valid approach or a violation of the D programming language?

Patrick Schluter Patrick.Schluter at bbox.fr
Sat May 15 12:53:37 UTC 2021


On Friday, 14 May 2021 at 22:33:24 UTC, Witold Baryluk wrote:
> On Sunday, 9 May 2021 at 20:20:15 UTC, Berni44 wrote:
>> [...]
>
>
> Another disadvantage of using `import std` is compile time.
>
> I often have my projects on `sshfs` file system, that is 
> mounted from a server in a different country. I often mount 
> with default options, with has very short "negative cache" 
> timeout (i.e. lookup was attempted, but didn't found a file), 
> and medium "positive cache" timeout (lookup or read was done, 
> and it did file and a content).
>
> [...]

`import std;` has always been a convenience feature for D as 
script language (`rdmd`). It was never intended to be part of a 
normal project. Normal projects should use selective imports or 
scoped imports. Using `import.std;` otherwise is a violation of 
the intent.


More information about the Digitalmars-d mailing list