Phango - questions

Christopher Wright dhasenan at gmail.com
Tue Nov 20 06:28:45 PST 2007


Sean Kelly wrote:
> Christopher Wright wrote:
>> Don Clugston wrote:
>>>
>>> Incidentally, one stylistic change between Phobos and Tango which 
>>> hasn't been mentioned, is that Phobos uses a flat structure (except 
>>> for a couple of things like std.c.windows.windows!). IMHO, the flat 
>>> structure is decidedly inferior.
>>
>> Why is that?
>>
>> I work on a decently sized (40k lines) project in C#, and we're moving 
>> from a deep hierarchy to a shallow one -- it's less typing, and we 
>> don't see any advantages in the deeper structure.
>>
>> If you point out a reasonable advantage, then I can probably work 
>> quicker.
>>
>> The documentation should be hierarchical or task-oriented, of course, 
>> so you can find what you're looking for easily.
> 
> This is why I like deeper hierarchies.  I tend to look at the code 
> itself for reference more often than the documentation itself, so it's 
> nice to have the code grouped in a manner that matches the documentation.

One could argue that you just need better documentation.

Also, this hierarchical documentation could be as simple as "if you want 
to accomplish this task, you should look at this module", and then it's 
O(1) to get to the file in the flat structure, not O(log n) as with the 
hierarchical one.

And again, you only have to write a module once, but you read it many 
times. When you're reading it, you know exactly which modules it 
references, so a flat structure is faster.

Also, a documentation hierarchy can be entirely independent of the code 
hierarchy, so you would put your collection documentation in the 
collections folder, not util/collections, so it's more easily 
discovered. Or other things like that, where the structure of your 
packages is not desirable but you can't change it immediately due to 
legacy code.

I don't recall ever having browsed through the source of a library in 
search of some functionality; it's always been a particular module. The 
documentation is where I search first.

I guess I'll be using Tango more when it has a stable D2 release and I 
have a good IDE that can auto-import for me.



More information about the Digitalmars-d mailing list