Phango

Alix Pexton _a_l_i_x_._p_e_x_t_o_n_ at _g_m_a_i_l_._c_o_m_
Sun Nov 18 17:00:08 PST 2007


Kris wrote:
> "Alix Pexton" <_a_l_i_x_._p_e_x_t_o_n_ at _g_m_a_i_l_._c_o_m_>
> 
>> I will give you credit, Tango is very consistent in its style and much of 
>> the code is very elegant, but I believe very strongly that the decision to 
>> use mixed case identifiers for BOTH module names AND classes was a 
>> mistake.
> 
> Thanks, Alix, for offering an honest perspective. It's a shame that it 
> conflicts so much with your personal preferences. However, fwiw, you'd only 
> ever see that in the import section at the top of a module, so perhaps it's 
> not so bad? You can also use import renaming, or you can group Tango package 
> imports into a single wrapper import (which lots of people have already 
> asked for). For example, other people have been asking for this:
> 
> # import tango.io.stream.all;
> 
> 
>> All the other issues I have with the layout of the library stem from this, 
>> but it seems that you are an immovable object, and alas I am not an 
>> unstoppable force.
> 
> That's not the case at all. As I've said a couple of times in this thread: 
> as much as we might like to, we can't go making sweeping changes to the 
> library based upon a personal preference, because such changes would 
> inevitably conflict with the personal preference of others. There's no way 
> to resolve that dillema. Period. So, it's not that we're immovable at all. 
> In fact, we're perhaps 'extremely' open to change, and often turn things 
> around in real-time.
> 
> Cheers;
> 
> 
> 
> 

Its not as simple as personal preference, my preferences nor anyone elses are the issue here.

I'm going to spell this out as carefully as I can even though I am quite tired, and I thought I had doneso several times already.

As I understand it, your argument for using CamelCase for your module names is two fold.

1) Importing "tango.Foo" gives one access to the class within "Foo" called "Foo"

2) Using "PenIsland" (where Foo and Bar are real words with real meanings) instead of "penisland" means the meaning can not be mistaken for "penis land". (actual website btw)

Now, by far the vast majority of module names that I have encountered outside of Tango are either abstract or a single word, and DO NOT share the name with any of the classes inside. This makes it a convention, and one that I believe has a very good track record for being easy to understand and with good reason.

In D, I know I am importing modules, not individual classes, I expect a module that I have imported to have in it some related classes and functions, some of which I might not use and will be pruned by the linker, but that they will all have names that are unique identifiers.

In Java, I know that I can import whole packages with .* (in which case I must take care within my own namespace not to shadow in imported class) or I can import an individual class and get just that class. When I first looked at Tango I though... "yay, they guys have given me a way of importing individual classes, albeit via a bit of a messy namespace kludge," but I began to realise that all was not quite as it seamed.

Sometimes a Tango import brings along a bunch of other classes that I wasn't expecting, might have been added since I last looked at the library source and suddenly introduce identifiers that might be in my code. Thanks to D being D, my code at least does not compile, I hope!

So you see, or I hope you do, that the CamelCase is just the tip of the issue as I see it, and that mixing up modules that are just modles, modules that are just classes and modules that are both, can create confusion and introduce errors.

Maybe its not Tango's fault at all, maybe D is wrong about the correlation between namespaces, modules and classes and you are just doing the best you can within the system.

I really don't like having to carefully alias module names and classes so that free functions and static methods don't look the same or having to be uber familiar with the source of the library to know which modules contain multiple classes and which contain none at all.

In another language, your scheme might work fine, and this issue would not crop up, but this is D. If Walter had, despite his good intentions, implemented D so that it was more confusing to use than C++, its very unlikely that we'd discussing this at all. So it alarms me that Tango is promoted as THEE alternative library when the way it works and the way it is inflexibly conglomerated is so unlike the language itself.

I know about wrapping and aliasing the imports and all that sort of thing, but I think you will agree that goes against one of the key principles that sits at the foundations of "the D mentality". That is, that the easiest way to do something should be the right way to do it, (or perhaps just conversely, that the hard way should be the wrong way.) It doesn't matter how politely you ask, the consumers are not always going to jump through hoops to make their code readable, and in the end all your suggested solution does is move the problem to another location, and in some cases actually hide it completely.

On the occasions when I have used Tango, I feel like I am fighting it, where as Phobos, the Java runtime and maybe 75% of C++ libraries that I have used seem much more intuitive. Some of the libraries that I have found easiest to use, actually really sucked once you looked under the hood, but they had got the packaging right for their respective language.

I'm not a professional developer, or even really more than just a passtime programmer, but I do know more than my fair share about marketing. I'm not trying to sell you my opinions, but with current first impression that I get of Tango, and the attidude that comes across (intended or otherwise) when I and others offer constructive feed back, I wonder if you actually want people to use it at all. It's as if you are writing a library simply for the sake of writing a library, of perhaps out of some sort of selfish passion to be a creator, expecting the end user to just use it and be thankful. You have given up all these ours to make the internals reliable and all those other things, don't you want people to use the damn thing?

I hope that in all my input here I have at least come across as calm and respectful, but I'm begging to feel that I can only get my point across by deviating from that demeanor. I don't know what anyone else thinks, but each time I read a new anouncement or a developer's reply to a Tango related thread, the first thought that enters my head is "gah, that arogant committee of fools," but I know that you are not fools when it comes to the inner workings of your code, only where the way that you present it is concerned. And no I did not jst call you fools, for even the wisest of people can occasionally do foolish things, just as experts can make descisions that later make them appear to be amateurs. Its for this reason that most of the time I read the posts and not who has posted them, and when the topic is not Tango, why I am not surprised if I later find out where the smarter comments and suggestions come from.

Metaphorically speaking, if Tango were a member of your preffered sex, they would probably be rather attractive, but I think it would be dressed in a flour sack, but pouting like it was Versace's finest, Ditch either the sack or the attitude, a shy smile and/or jeans and a tee will get you a lot further.

I realise that this has been a rather rambling explanation of the issues as I see them, and that perhaps fatigue has tainted my logic with a little anger, but I only want to help you to realise that the very fastidiousness of the consistency that you have applied to your module naming scheme is the very thing that actually makes it inconsistent. And if you change nothing else, change the attitude with which you arrogantly dismiss the genuine concerns of people who want D as a whole to be a success.

A...



More information about the Digitalmars-d mailing list