Tango Group Imports

Lars Ivar Igesund larsivar at igesund.net
Sun Dec 23 03:55:34 PST 2007


Marcin Kuszczak wrote:

> Lars Ivar Igesund wrote:
> 
>> Dear D community,
>> 
>> In a response to community requests for fewer imports in Tango programs,
>> especially for the smaller ones, we have created an experimental package
>> called "group". This contains several modules, each publicly importing a
>> themed collection of Tango modules. For example: tango.group.net and
>> tango.group.stream.
> 
> Well, I am not so sure that it is really what community wants. (BTW which
> people are considered as Tango community? From D newsgroup? Tango users?
> People from Tango IRC or Tango Web forums? People who doesn't use it now
> by might use it in future?) Reading a few messages which have appeared on
> D newsgroup and justifying your solution by myself I would rather say that
> the problem is different and solutions solves other problem than
> requested.

We are not sure either that tango.group is what the community wants
(community here meaning D community, not necessarily Tango, although that
may or may not be interchangeable), but note that requests from a single
person wouldn't go in that category :) So this feature, in some form or
another has been requested. Not because the hierarchy is deep, but because
some think simple programs need too many imports. There is of course some
necessity in such a feature having a short import paths.

> 
> The problem, as I am seeing it, is that module paths are too long (deep
> hierarchy). It causes some problems. Let me enumerate them once again:
> 
> 1. Lot to write in one import (quite trivial, but still problem)
> 
> 2. Difficult to remember where to find specific module. It should be
> possible to find necessary module just using autocompletion feature in
> IDE. Currently autocompletion doesn't help much, as hierarchies are deep
> and it's necessary to remember path anyway.
> 
> 3. Sometimes modules are distributed in a quite illogical way. Or maybe it
> would be better to say: not for everyone it is equally logical. The reason
> is that nested package names are too loosly related with each other in
> human mind (and especially in programmer mind). Example: net -- cluster;
> util -- collection, core -- threading. Please try to find connection
> between them in:
> http://www.visuwords.com/fullsize.php
> (I know that they are related, but this relation is quite weak, so it
> gives impression that it is not logical).

Yes, I know you have these opinions, but compared to the group import
feature, this is not something we consider a very highly requested thing to
fix, and so we cannot say that there indeed _is_ a problem that needs
fixing. Your points are sane of course, and you may in some respect be
correct. If we were to change import hierarchy (I don't see how that is
possible before 1.0 given our capacity), we would need to put _a lot_ of
thought into it, to truly improve on the current situation, which I
personally find quite good. For some packages, a solution similar to that
of time may be appropriate, but we feel there is a limit to how many
packages should be at the highest level too.

If you want such a process to start (be warned, it may not lead to
anything), you need to write up a fairly complete proposal with the
necessary reasoning and post it via a ticket.

> 
> The problem which was solved by grouped imports is different. I can agree
> that such a feature can be usefull, but only for people who uses some
> specific group of modules very often in his/her code. When I would write
> program which needs a lot of time calculations in almost every piece of my
> code I would prefer to import whole time group at once, because it would
> simplify my work without any costs. For example please show me a person
> who uses in his/her code a lot of different kind of containers in almost
> every module, so it would justify using "import tango.groups.collection"?
> Usually you need two, three types of containers and that's enough.
> In fact importing all types of containers, when you need just one or two I
> would consider as a bad programmin practice. So this kind of group import
> would be probably useless for people in most cases...

Still, many people want this :)

> At the end I want to say that I really miss newsgroup dedicated for
> library development. I know that Tango people prefer IRC and Web Forums,
> but I have to say that this channels of communications are very
> inconvenient for me. I usually have only a little time in the evening to
> read/write something so newsgroup is very convenient. It doesn't need from
> me my immediate answer (like IRC), and allows me to use convenient
> environment (my environment - not the one which somebody decided is good
> for me - I mean web interface).

Unless one could truly integrate Trac with a dedicated Tango newsgroup
(something like bugzilla and D.bugs), we feel that NGs lacks too much
trackability for incoming requests and the surrounding discussions.

IRC is convenient for the cases where some real time talk is preferable to
close cases that seems to stay too long in the pipeline in other fora.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango



More information about the Digitalmars-d-announce mailing list