Author |
Topic |
|
awholmes
New Member
4 Posts |
Posted - Sep 10 2009 : 05:10:28 AM
|
Highlighting of Local symbols is a good thing. You can avoid many noob errors as well as hard to find typo errors
Q1: The 'Local symbols in BOLD' feature is pretty useless for me at the moment
You should really discriminate A. variables local to a function from B. static(global) variables local to a file from C. static class variables defined in .cpp file
(C. are highlighted (v.10.5) in the .cpp but not in the .h file !)
Q2: Why do you only offer highlighting of locals in BOLD??? Locals seam LESS IMPORTANT. so i would use the following default: gray (or maybe italics) for locals (group A.) BOLD for globals (group B.) and nothing for statics (group C.)
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Sep 10 2009 : 09:54:24 AM
|
To try and answer question 1, VA's colouring code has to run very quickly in order to keep up with code scrolling, editing, and to avoid slowing down the editing experience.
To make the code run fast enough it has to use a fairly simple approach to deciding how to colour each symbol. Plus we do not always have enough information while colouring, which has to be done behind the IDE's back, to correctly identify exactly what a symbol is.
The standard example here is when you have a function and a variable with the same name, but they are both given the same colour.
So our current approach is to do enough to be useful, given these limitations.
Question 2, my understanding is that good practice says you should not use global variables at all, so for most people colouring these separately is not going to be important.
Static class member variables is again down to the speed at which our colouring code has to run. If you place the caret into a variable you should see extra information in VA's context and definition fields, to help you identify exactly what it is. |
zen is the art of being at one with the two'ness |
|
|
awholmes
New Member
4 Posts |
Posted - Sep 11 2009 : 05:22:08 AM
|
please stop whining about performance issues on virtually EVERY request.
i'm sure there is simple and effecitve way for you to find out if a variable is truely local or file local or static to a class |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Sep 12 2009 : 09:43:33 AM
|
Most requests do not have an impact on performance. What requests are you thinking about?
There are already performance problems under certain conditions. I assume you are not running into them, but if you know how to trigger them, then they do show up, and people get very upset when they cannot type / scroll normally since the CPU is running at 100%.
Static variables being bold, which IDE and version of VA are you using? I have just tried the following code in VS2005 using VA 1735. The header file contains:
class testBoldStaticMemberVar
{
public:
static int m_nStaticMember; // not bold in header
int m_nMemberOne, m_nMemberTwo; // not bold
void testMemberFunction();
};
and the matching cpp file contains:
int testBoldStaticMemberVar::m_nStaticMember; // bold in cpp file
void testBoldStaticMemberVar::testMemberFunction()
{
// none of these are bold in cpp file
m_nMemberOne = 1;
m_nMemberTwo = 2;
m_nStaticMember = 3;
}
the comments explain what I am seeing. Yes the class static variable is shown in bold where it is declared, but this is unlikely to cause much confusion. The static member variable is not being shown in bold when I use it in the cpp file. |
zen is the art of being at one with the two'ness |
|
|
awholmes
New Member
4 Posts |
Posted - Sep 14 2009 : 06:05:08 AM
|
i see the same, yes. the statics are bold in the .cpp declaration part, but not in the rest of the file.
THIS IS CONFUSING. one symbol shown differently in differtent part - isn't it. especially if you call it "show LOCAL symbols in BOLD".
my global variables (YES, there are some) are also shown in BOLD. as i said. this is annoying. You should probably give free c++ code design lessons to every customer to solve the issue;o) |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Sep 14 2009 : 10:24:02 AM
|
We are considering trying to make the code for colouring variables bold more reliable, more sensitive to scope, but it is not a high priority change at the moment:
case=2364
Partly I am asking these questions to get a sense of the scale of the problem. Advice C++ code design is tempting, but not really workable I know that in game development sometimes global variables are used very heavily since the performance gain is more important than making the code "good". So what is good for one person might be bad for another person.
I work hard to remove global variables in my code, but this is not always realistic. Personally I put "g_" at the front of the variable name for globals, to make sure I realise they are "special" and need to be treated carefully. |
zen is the art of being at one with the two'ness |
|
|
foxmuldr
Tomato Guru
USA
414 Posts |
Posted - Oct 13 2009 : 06:09:52 AM
|
Why don't you write a drop-in IDE for Visual Studio? One that you wholly own?
If you cannot do it directly through some built-in feature, surely you can sub-class the HWND, overlay it on the same window coordinates, and then each the actual changes back to the "real window" underneath?
- Rick C. Hodgin |
|
|
foxmuldr
Tomato Guru
USA
414 Posts |
Posted - Oct 13 2009 : 06:11:43 AM
|
quote: Originally posted by foxmuldr
...and then each the actual changes back to the "real window" underneath?
Should be "and then send each of the actual changes (to source code) back to the "real window" underneath?
- Rick |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Oct 13 2009 : 1:12:05 PM
|
Stop and consider just HOW many features and commands the IDE has and offers... this is a very scary idea, and a vast amount of work without offering an obvious and vast gain. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|