D Conference Tango Phobos

Bill Baxter dnewsgroup at billbaxter.com
Sat Sep 15 12:40:46 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;

That's not the only way to do output with Tango.  I don't recall the 
exact syntax, but there's another syntax that lets you do the format 
string style   somethinsomethin.("{} = {}\n", i,s)

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

I don't know if there was any good reason for it, but it looks like a 
Java influence to me.

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

Stdout is a class instance, actually.  Akin to cout in C++.  'course 
instances are usually written lower case too...

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

It actually just chaining, not currying. Stdout( foo ) returns 'this', 
just like C++'s iostream's operator<< does.

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

I don't know but my guess would be it flushes in addition to printing a 
newline (like C++ endl)... and checking the source, yep.  That's what it 
does.

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

Yep.  I like it too.  Works most of the time.  But it gets you into 
trouble if 's' contains format sequences (like "%s", "%d", etc).

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

I think there's a strong C#/Java-using contingent among the Tango 
developers.  I believe that had a lot of influence on the style of Tango.

Anyway, these folks have put an enormous amount of their free time into 
putting together and maintaining a decent library that presumably 
matches *their ideal* of what a library should look like.  They're the 
ones doing the work, so they get to decide on the style and conventions 
used.  Simple as that.

--bb



More information about the Digitalmars-d mailing list