Phango - questions

Sean Kelly sean at f4.ca
Sun Nov 18 14:22:46 PST 2007


Bill Baxter wrote:
> 
> The Tango convention may be better for all I know, but I don't recall 
> hearing any compelling arguments in favor of why a change was needed. If 
> they were given and I just forgot them, then sorry.  I do recall hearing 
> unsubstantiated claims like "we found it was better" or "we found the 
> phobos convention to be insufficient" etc, but I don't recall any actual 
> good arguments that made me go "hmm ah, yes indeed".  Anyway given that 
> this topic continues to come up, it seems it would be a good idea to 
> collect all these reasons on a page over at tango.dsource.org.

I think some of the reasons may be there already, but the page is broken 
(for me anyway) so I can't tell you where to look.  I'm not sure if it 
helps, but I resisted the idea of CamelCase module names when we began 
working on Tango, possibly because I come from a C/C++ background.  But 
as Tango has grown I've come to appreciate the readability that the 
scheme provides.  For example, many of the module names in Tango are 
multi-word combinations: DeviceConduit, MemoryConduit, EndianProtocol, 
VirtualFolder, etc.  I feel that eliminating the caps in these names 
would render them largely unreadable: deviceconduit, memoryconduit, 
endianprotocol, virtualfolder...  The C/C++ way would be to find some 
abbreviated form instead, but I hesitate to think that such names would 
be more clear.

I suppose one could argue that following the Java approach in Tango 
results in unneeded redundancies, such as the DeviceConduit module 
containing a DeviceConduit class, but again, I would argue that choosing 
an arbitrary name to avoid these redundancies would reduce clarity.  As 
it is, I know that if I want to use a DeviceConduit in my app, I just 
have to import tango.io.DeviceConduit.  There is no need to remember 
that the class actually lives in tango.io.blah instead.

As for capitalization being confusing for people using case-sensitive 
vs. case-insensitive filesystems, I suppose this is a problem I have 
simply never been exposed to.  D is a case-sensitive language, so I 
would expect people using D to not make mistakes regarding 
capitalization, particularly when the capitalization in this case 
follows a simple and established convention (even if that convention 
doesn't match what is in the D style guide).  Has this truly been a problem?

Finally, I'll admit to being a bit baffled about what the big deal is 
anyway.  The C/C++ standard library uses lowercase for /everything/, 
type names included, and I've yet to see someone complain to the various 
committees about this, even when third party libraries for the same 
language follow a different convention.  And things are even worse in 
C++ because the library relies on specifically named typedefs to 
operate, so the convention there is viral by necessity.

Regarding D, Phobos, and Tango, I think the differences between the 
Phobos and the Tango convention are small potatoes.  Import lines may 
look a bit different, but /that's it/.  The only other difference in 
style concerns global objects, of which Tango has perhaps 3-4, all of 
which could be aliased to something else or wrapped in about ten 
seconds.  How can such an issue possibly be enough to discuss so much, 
let alone to use as grounds to reject a library entirely?  Frankly, if 
this is the worst thing that people have to say about Tango then I think 
the project has succeeded beyond my wildest expectations.


Sean



More information about the Digitalmars-d mailing list