T O P I C R E V I E W |
drzoom |
Posted - Dec 14 2006 : 07:45:13 AM Preface: I use to name variables often like the type is called. A local variable of the type "SlotFactory" I call "slotFactory", a member variable get the name "m_slotFactory" or "_slotFactory".
Topic: There should be a suggestion for a new variable name based on the type on the left.
Your objections: - There are a lot of different naming schemes, not every developer prefers to do that. (I think: it's only a suggestion, take it or ignore it.)
Bonus features to implement: - An addition suggestion for the people which believing in type prefixes (e.g. Foo* pFoo;).
- The selected naming scheme is stored and the preferred name is displayed as first suggestion.
|
1 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Dec 14 2006 : 09:31:01 AM I do something similar, so I see the appeal. The immediate problem is what to do with things like:
CVeryLongNameForAComplexClassThatDoesSomethingStrange m_foo1; std::vector<int, std::pair<std::string, CBar> > m_foo2;
Next up for String's I tend to use "m_strName" since I don't want to be using "string" all of the time.
For this to work I have a mental vision of a table, two columns, lots of rows, where each row is the class type and then the name to put into the member variable name.
I am starting to think that an IDE macro is the best solution here. The basic concept would be to take the word before the caret, run a switch statement on it, and then generate a standard name "snippet" as a result. |
|
|