Declare and Define Before Use? [rant]

kdevel kdevel at vogtner.de
Wed Apr 4 18:57:27 UTC 2018


Why are people writing

    import std.stdio;

    void main ()
    {
       S s;
       s.foo;
    }

    struct S {
       void foo ()
       {
          writeln ("a");
       }
    }

but not

    void main ()
    {
       S s;
       s.foo;
    }

    struct S {
       void foo ()
       {
          writeln ("a");
       }
    }

    import std.stdio;

?


More information about the Digitalmars-d-learn mailing list