Some Basic Questions

Bruno Medeiros brunodomedeirosATgmail at
Thu Aug 17 04:04:50 PDT 2006

Derek Parnell wrote:
> On Wed, 16 Aug 2006 00:31:47 +0200, Lutger wrote:
>> Derek Parnell wrote:
>>> No, I suggest you use a different naming convention. I would have your
>>> class name start with a Capital letter and have your source file name all
>>> lowercase. And if you stick to one class per file, have your filename
>>> different to the class by adding a suffix or prefix. For example,
>>>   module foo_m;
>>>   class Foo
>>>   {
>>>    ...
>>>   }
>> Can I ask you, what is your reason for naming a source file differently 
>> than the class? Does it have something to do with importing magic?
> It is a personal POV of course, but I do it to avoid source code looking
> like its hard to read. In other words, the references would look like ...
>   auto x = new  foo_m.Foo;
> rather than
>   auto x = new Foo.Foo;
> The duplication of symbols can get confusing after a while.
> In Build, the class called 'Source' is contained in the module 'source.d'
> and this makes a lot of code look strange. Especially when using static
> members of the class.
>   foreach(Source s; source.Source.AllFiles) ...
> But each to their own.

Why do you access Source above in two different ways, in the same line? 
with base name "Source" and later with FQN "source.Source"?

Bruno Medeiros - MSc in CS/E student

More information about the Digitalmars-d-learn mailing list