D Conference Tango Phobos

Sean Kelly sean at f4.ca
Sat Sep 15 12:22:43 PDT 2007


Janice Caron wrote:
> On 9/15/07, TomD <t_demmer_no_spam_ at web.de> wrote:
>> What really worries me is the total absence of Walter in this discussion. I had another look at Tango and again came to the result I do not like it. It would really be a pity seeing Phobos going down the drain.
> 
> I had not looked at Tango before this discussion, but now that I have,
> I have to say I don't like it either. It's not the functionality that
> irks me, it's the /style/. I mean:
> 
> import tango.io.Stdout;
> Stdout( i )( " = " )( s ).newline;

This is only one of about four styles for IO, and it's probably the 
least commonly used these days.

> Module names in mixed case!? Did the Tango folk not read the D style
> guide where it says "Module and package names are all lower case, and
> only contain the characters [a..z][0..9][_]", or did they just
> purposefully decide to avoid it? If the former, that was amateurish;
> if the latter, it was petty.

Or perhaps there was another reason for the decision.  Kris could 
explain the rationale best, but some of it is covered here:

http://www.dsource.org/projects/tango/wiki/CodingConventions

> Function names in mixed case? I assume Stdout is a function. Phobos
> has function names in lower case, and that's how I like them.

It's a class instance, actually.  And I agree that this is a bit 
contrary to typical coding conventions.  I believe it may be this way 
because the routines were previously static methods and no instance 
existed at all.

> Currying parameters? (That's the malarky with the brackets). What's
> wrong with variadic arguments?

Please see Stdout.format().

> And what's with the .newline? Isn't "\n" supposed to translate to the
> platform-specific linebreak convention? Besides, it looks weird,
> having the newline specified differently from all the other bits of
> output.

You're free to use "\n" as well--it works in all the cases I've tried. 
The .newline method is similar to std::endl in C++.

> I was happy with:
> 
> import std.stdio;
> writefln(i," = ",s);
> 
> I still am. I don't see that changing any time soon.

     import tango.io.Stdout;
     void writeln(Args...)( Args args )
     {
         foreach( arg; args )
             Stdout( arg );
         Stdout.newline;
     }

Perhaps not perfect, but not bad for ten seconds of typing.

> Granted, Tango has extra functionality, but why not just provide that
> as add-ons to Phobos, using the same style and naming conventions?

Because the coding conventions proved insufficient for a library of this 
size.

> My apologies if I come across as contentious. I realise I'm a newbie
> in this group. But that is the first impression I get from looking at
> the Tango docs. I just ask myself over and over again, "Why did they
> do that?" (...which should be regarded as a rhetorical question which
> really means "I wish they hadn't done that").

I suppose it would help if we made public the volumes of discussion we 
had prior to release :-)  However, the website does have quite a bit of 
the rationale if you dig around a bit.  In particular, the contributor's 
section is fairly informative:

http://www.dsource.org/projects/tango/wiki/RollickingFellowsGuide


Sean



More information about the Digitalmars-d mailing list