R
Randy Budd
The one major beef I have with C/C++ is that there are so many variations
for
the same word. For example:
static global variable - variable accessible only from within source
file
static function - function accessible only from within source
file
static variable in function - variable whose value gets retained between
calls
static member variable - variable with one value for all classes
static member function - function accessible from outside the class
Why do they use the same word (static) for these multiple uses, when they
clearly have different effects? Is there some underlying reason why they
are
the same word, or is it the result of the original authors trying to be
clever
and trying to save on new keywords? Why not use a new keyword for each
of the
uses?
The same thing goes for const. Having a const char * variable const is
technically correct and I understand what it means (I think), but
wouldn't it
be more intelligent to use a different keyword when used on the left side
of
a variable than when on the right side? It would definitely make things a
lot clearer.
Does anyone know if there is any historical significance to why they use
the
same words multiple times?
Thanks
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your
Own
for
the same word. For example:
static global variable - variable accessible only from within source
file
static function - function accessible only from within source
file
static variable in function - variable whose value gets retained between
calls
static member variable - variable with one value for all classes
static member function - function accessible from outside the class
Why do they use the same word (static) for these multiple uses, when they
clearly have different effects? Is there some underlying reason why they
are
the same word, or is it the result of the original authors trying to be
clever
and trying to save on new keywords? Why not use a new keyword for each
of the
uses?
The same thing goes for const. Having a const char * variable const is
technically correct and I understand what it means (I think), but
wouldn't it
be more intelligent to use a different keyword when used on the left side
of
a variable than when on the right side? It would definitely make things a
lot clearer.
Does anyone know if there is any historical significance to why they use
the
same words multiple times?
Thanks
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your
Own