Tango Group Imports

Marcin Kuszczak aarti_please_no at spam_interia.pl
Sat Dec 22 14:00:24 PST 2007


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.

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).

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...

Anyway I am happy that at least time package found its way out from util
into root :-)

(Reference:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=62424
)
 
> These are now in Tango SVN trunk, and will be part of the next release.
> Considering they are an experimental feature, we will look to your
> feedback before deciding their fate.

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).

So I definitely vote to open newsgroup:
digitalmars.D.library (ping: Walter)

-- 
Regards
Marcin Kuszczak (Aarti_pl)
-------------------------------------
Ask me why I believe in Jesus - http://www.zapytajmnie.com (en/pl)
Doost (port of few Boost libraries) - http://www.dsource.org/projects/doost/
-------------------------------------




More information about the Digitalmars-d-announce mailing list