Some Basic Questions

Derek Parnell derek at nomail.afraid.org
Tue Aug 15 17:23:22 PDT 2006


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.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
16/08/2006 10:18:56 AM



More information about the Digitalmars-d-learn mailing list