Thread: How to manage variable and function names

  1. #1
    Registered User
    Join Date
    Jan 2008
    Location
    Singapore
    Posts
    5

    How to manage variable and function names

    Hi,
    I've written some codes (actually quite a lot, around 30 files) ... in Linux ... but i would like to change names of my Classes, Variable Names and Functions, any way to change it quickly and safe?
    Any tools allow me to manage that?
    Thanks
    Jeff

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Eclipse is an IDE that has this feature, and as far as I know, it's free too.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    You're basically talking about a refactoring tool. A search of the Web brings up this list of refactoring tools. The good part is that it lists 3 for C++. The bad part is that it only lists 3 for C++.

    Eclipse is an IDE that has this feature, and as far as I know, it's free too.
    Now, if only those guys over at Netbeans ported over their refactoring functionality for their C/C++ plugin...
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    I think Turbo C++ had that feature. Though I'm not sure if you should depend on it for anything else (the editor is not bad, but I'm not sure about the compiler).

    EDIT: sorry, forgot you wanted a utility for Linux. I think Turbo C++ is for Windows only.
    Last edited by Abda92; 01-26-2008 at 12:42 PM.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    The compiler is worse than the editor (by far)
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Abda92 View Post
    EDIT: sorry, forgot you wanted a utility for Linux. I think Turbo C++ is for Windows only.
    Technically for DOS mainly, but certainly not Linux.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    By the way, Emacs has some pretty good search/replace facilities - and as long as you rename one thing at a time, you can check with the compiler that you got it right...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    That refactoring tool list I linked to lists Xrefactory, an emacs plugin, as one of the tools for C++.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Registered User
    Join Date
    Jan 2008
    Location
    Singapore
    Posts
    5
    Thanks, Witch,
    This is a great help ...

  10. #10
    Registered User
    Join Date
    Jan 2008
    Location
    Singapore
    Posts
    5
    the Eclipse is easier to learn, Xrefactory is a bit complicated for me ...
    Eclipse C++ IDE is perfect

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Perfect? I doubt that. Nothing is perfect, and Eclipse even less so than other, specialized, IDEs I would think.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Registered User
    Join Date
    Jan 2008
    Location
    Singapore
    Posts
    5
    Haha, Elysia took it quite seriously ... i should have said "perfect for my needs, my skills, and my time " ...

  13. #13
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Last time I tried to use Eclipse, it was an extreme pain to set up. So I can't quite call it perfect. Though it wasn't for C++, I would image it's still the same.
    And I don't think there's a compiler either? So that means manual compiling? Fun...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #14
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    http://wascana.sourceforge.net/

    Download, install, enter your code, press build.

  15. #15
    Registered User
    Join Date
    Jan 2008
    Location
    Singapore
    Posts
    5
    Really, i didn't have difficulty. Download, install, new project, add file system, Right click, refactor .. that's it ... :|

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM