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


Robert Dewar wrote:

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.

So, you are saying that nobody should be able to understand a hardcopy
printout of code on it's own. They should be required to examine it
inside of a GUI infested enviornment?

Seems like it's just making it harder to work with the code, instead of
easier.

Also, the clickie thingie will only work if it can parse the code, but
if I'm trying to get someone elses code to run on my *other-brand*
machine, and I have syntax errors, the GUI tools will probably not
be able to get their info until the syntax errors are gone, but I can't
get rid of the syntax errors if I can't figure out what the code is
supposed to do, which requires the tools, which ...

I still think it would cause more maintainence problems than
any help it would be for someones tired fingers.

90% of the cost of a program is usually in it's maintenance.

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

shouldnt that be ;-)

   with (*Julian_Date_At_Maturity)
   {
       ++;
   }

sorry, couldn't help myself.

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

So, you want to use long names, but you just don't want to use them?

There is a point at which a name becomes too long to be convienient,
and if it is too long to type when needed, then it is probably too long to
consistantly type correctly. At that point it's more of a burden then a
help.

I've also seen enough programs with long names containing misspelled
words in them. Knowingly typing the *wrong* name is a bit
disconcerting (and I'm a bad speller, so it needs to be really wrong
for me to notice)



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