This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++ "with" keyword


> And to search for references to a structure becomes much more
> complex.  Instead of looking for a '.x' or '->x', you must now search
> for 'x', and then look to see if the reference is within a 'using'
> clause.

You are imagining a very low level environment. In GNAT (using GPS) if you
click on an entity, you get immediately to its declaration, and of course
such a tool would disambiguate a reference immediately. You are also
talking about misuse of the feature if you are talking about hundreds of
lines of text.

> If long names are causing you typing problems, then DON'T CREATE LONG
> NAMES IN THE FIRST PLACE. The "standard" C and C++ libraries usually
> use fairly short names for everything. Most of the long names I've seen are
> those created specifically for the program in question.  If the long 
> names are
> a real problem for you, then why create them in the first place?

Well that's the strongest argument in *favor* of WITH so far :-)
Keeping names short because they are too painful to use is a significant
negative effect, since well chosen longish names can often make a big
difference to readability of code.

Now it is true that the C++ syntax style generally favors short names:

  *p++

is a much nicer notation than

  Julian_Date_At_Maturity++

so you could argue that a feature that made it more convenient to use long
names was inconsistent in style with C++ :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]