Author Topic: variable/type name question  (Read 7035 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5229
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
variable/type name question
« on: August 31, 2012, 03:49:45 am »
Code: [Select]
   // pair of current-file-filter
    TokenFilesSet    m_CurrentFileSet;
    TokenIdxSet      m_CurrentTokenSet;
    TokenIdxSet      m_CurrentGlobalTokensSet;

and:
Code: [Select]
for (TokenFilesSet::const_iterator itf = m_CurrentFileSet.begin(); itf != m_CurrentFileSet.end(); ++itf)

See, we have XXXXsSet or XXXXSet?
I think we should choose one kind of name theme for all the source files.

EDIT:
Just query on Google, like:

"fileVector" filetype:cpp   -> 1440 results
"filesVector" filetype:cpp -> 75 results

"threadpool" filetype:cpp -> 23600 results
"threadspool" filetype:cpp  -> 10 results

Compare the other similar result, we should use XXXXSet, right?
 

« Last Edit: August 31, 2012, 05:23:13 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9592
Re: variable/type name question
« Reply #1 on: August 31, 2012, 06:20:27 am »
Compare the other similar result, we should use XXXXSet, right?
Yes.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5229
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: variable/type name question
« Reply #2 on: August 31, 2012, 06:44:51 am »
Compare the other similar result, we should use XXXXSet, right?
Yes.
OK, so we need to re-factor on those names, also it looks like "tokenstree.h/cpp" should be "tokentree.h/cpp".
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9592
Re: variable/type name question
« Reply #3 on: August 31, 2012, 11:07:24 am »
OK, so we need to re-factor on those names, also it looks like "tokenstree.h/cpp" should be "tokentree.h/cpp".
Oh dear... some more effort... but yes.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5229
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: variable/type name question
« Reply #4 on: September 06, 2012, 03:49:44 pm »
OK, so we need to re-factor on those names, also it looks like "tokenstree.h/cpp" should be "tokentree.h/cpp".
Oh dear... some more effort... but yes.
I did a lot of names change in rev 8364, please help to change the file names. That may change the makefiles also which I don't familiar. Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9592
Re: variable/type name question
« Reply #5 on: September 06, 2012, 04:27:26 pm »
I did a lot of names change in rev 8364, please help to change the file names.
...should be done in SVN trunk.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5229
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: variable/type name question
« Reply #6 on: September 07, 2012, 02:57:12 am »
I did a lot of names change in rev 8364, please help to change the file names.
...should be done in SVN trunk.
Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.