"Gary Wessle" <ph****@yahoo.comwrote in message
news:87************@localhost.localdomain...
>
Hi
my toy project is spanning few files already, typing is becoming an
issue, is it acceptable practice to do the following globally?
typedef vector<doublevd;
typedef vector<pair<char,double vpcd;
Depends on who it needs to be acceptable to, I guess. :-)
One issue I'd have is that those names are completely unintelligible unless
you know in advance what they mean. Come back next year, and you'll wonder
"what the heck is a 'vpcd'?".
Something like DoubleVector and CharDoublePairVector might be more
descriptive. Of course, if all you're trying to gain is less typing, then
that's not saving much. But I rarely base decisions on how much or little
I'll have to type; instead, I go for clarity.
Also, a vector of recorded race times and a vector of space-time coordinates
(for example) may each be a vector of doubles, but wouldn't it make more
sense to have (say) a RaceTimesVector type and a CoordinatesVector type?
It's like a class: you don't call your class "csi" simply because it's a
class containing a string and an int. You name it what it is, something
more like "Competitor" or "PlanetDescription".
-Howard