Phango - questions

Oskar Linde oskar.lindeREM at OVEgmail.com
Mon Nov 26 09:33:06 PST 2007


darrylb wrote:
> Don Clugston 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.
>> Actually, I agree. I advocate shallow heirachies, not deep ones. But a 
>> completely flat heirarchy is not the same as a shallow one.
>>
>> Personally, parts of Tango's structure are a bit too deep for my liking. (I 
>> don't think frequently used stuff should be more that a couple of levels deep;
> 
> Ok, I usually just lurk and sit back and eat popcorn while reading the flames her e but I just had to comment...
> 
> Are you serious? You're worried about typing out a few extra characters in your import? Seriously, how much extra time is typing out maybe 10-20 characters going to cost you, as compared to say, writing the actual code for the module?
> 
> I'm not meaning to pick here but.. this just seems so inconsequential as to not even be worthy of mentioning.
> 
> If a slightly deeper structure leads to all sorts of benefits (logical separation, better segmentation of generated documentation, future-proofing expansion, etc) I really don't mind the extra 5 seconds to type out a bit more at the top of a module that I'll probably be working on for _much_ longer. Less typing? Sure, but the act of physically pressing keys and getting characters on the screen is _not_ the 'work' of the programmer... and 'tango.HashMap' versus 'tango.util.stuff.otherthings.collections.HashMap' .. who cares, as long as it works. After you're finished the 'pain' of typing that out once, you can always cut & paste it into other modules if it's that big of a deal :P

You are probably 100 % right that for a fully rational person those few 
extra seconds you spend typing a longer module name won't make any 
difference at all in the long run when it comes to productivity, but we 
humans are irrational. I'd say there are at least three more or less 
rational reasons why excessively long names are bad:

First, there is probably a psychological drive to minimize the effort we 
spend on doing things. We seem to have a bias towards overestimating the 
effort required for non-stimulating tasks while often underestimating 
the stimulating ones. Typing out a longer module name will feel like it 
would require much more effort than it actually would. For example, I'm 
betting that the number of uses for delegate literals in D increased 
quite tremendously when the short form (purely syntactical sugar) was 
introduced a while ago -- and that for very irrational reasons.

Secondly, thinking about a longer and more complex name requires greater 
cognitive effort, wasting resources better spent elsewhere. There are 
actually very few things we (or at least I :) ) can keep in mind at the 
same time. Lowering the apparent complexity of something makes it more 
likely to be used.

Thirdly, recalling a deeply nested name is much harder. Short names can 
be recalled as a single unit, while a name such as 
tango.net.cluster.tina.util.model.IServer probably requires several 
recursive memory fetch calls, flushing valuable caches in the process.

:)

-- 
Oskar



More information about the Digitalmars-d mailing list