Author |
Topic |
|
Mattijs
New Member
Netherlands
5 Posts |
Posted - Oct 03 2006 : 06:14:17 AM
|
When Visual Assist suggests the parameter list for a function implementation in a source file, it includes the values for default arguments of the function declaration as comments. Is it possible to turn off these comments? |
Edited by - Mattijs on Oct 03 2006 06:15:00 AM |
|
feline
Whole Tomato Software
United Kingdom
19022 Posts |
Posted - Oct 03 2006 : 1:02:49 PM
|
no. are they causing problems for you? or is this just a matter of personal preference? personally i find them very helpful, especially when dealing with overloaded functions. |
zen is the art of being at one with the two'ness |
|
|
Mattijs
New Member
Netherlands
5 Posts |
Posted - Oct 04 2006 : 04:22:29 AM
|
Thanks for the reply. They are not causing problems for me, I just delete them. My main problem is that the comments (obviously) do not change when the function declaration in the header file is changed. For example, when I change the last default argument of a function declaration in a header file from true to false, the comment in the source file will still show /* = true */. You have to realise to change comments every time when changing a default parameter. Otherwise, the comment is not helpful, but misleading. Therefore, I prefer to have no comments. About your last remark: I do not see the link between the default argument comments and overloaded functions.
|
|
|
feline
Whole Tomato Software
United Kingdom
19022 Posts |
Posted - Oct 05 2006 : 09:56:20 AM
|
if you are using the current release build of VA, 1535, sit on the function and try the new feature "Change Signature". this updates both the .h and the .cpp file, and updates the comments for you as well, all in one simple action
personally I find this to be invaluable, and a big time saver.
overloaded functions, perhaps this is just the way i structure my code, but sometimes I end up with something like this:
class doWork
{
private:
addRecord(int a, int b, int c);
public:
// both call the private function with the correct parameters
addRecord(int a, bool d = true);
addRecord(std::string a, bool d = true);
};
where changing the default parameter is a special case, only rarely used, which can have a fairly big effect. when i am sitting in the cpp file it helps me to be reminded that the bool is this default parameter, and that i need to keep a careful eye on it.
also it helps me when jumping up and down the cpp file to check how many parameters i need to pass |
zen is the art of being at one with the two'ness |
|
|
Mattijs
New Member
Netherlands
5 Posts |
Posted - Oct 06 2006 : 05:04:01 AM
|
I just discovered 'Change Signature', and that will make keeping the two function headers the same a lot easier! Still, it would have been nice to be able to turn the automatic comments off. |
|
|
feline
Whole Tomato Software
United Kingdom
19022 Posts |
Posted - Oct 07 2006 : 1:10:36 PM
|
we try to avoid adding options, partly because it is easy to have to many, but mainly because each option adds a lot of extra work, due to the way VA has to hook into the IDE all over the place. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|