Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Suggestion for new members and variables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

drzoom
Ketchup Master

Switzerland
57 Posts

Posted - Dec 14 2006 :  07:45:13 AM  Show Profile  Reply with Quote
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.



best regards
Tobias

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Dec 14 2006 :  09:31:01 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000