views:

319

answers:

4

My question title explains it all. This is extremely frustrating, especially when working with lots of similar constants. It works for Visual Basic projects but not Visual C#.

In general, why do the IDEs seem to be so different for the different languages (e.g. super-charged Intellisense in VB but not in C#)? To me it doesn't make sense for Microsoft to have two different teams working on the IDEs for the two main .NET languages...

+2  A: 

I don't have the answer, but I can tell you that the super-charged Intellisense(ie: vb background compiler) in VB will eat your CPU alive with a sizable solution open. I hope they never put that in C#. We converted our entire solution/product(25-30 projects) just because of it.

rick schott
A: 

Do you mean constants (const)? or readonly variables?

Also - if you can't tell what the value represents from the name, then you haven't named it right; most times you don't need to scrutinize the actual value of a const, since it doesn't change very often ;-p

If you mean const - then by definition the value is right next to it... but even so, when debugging hover works fine for me (I could post a screenshot if you like). The hover doesn't work when not debugging - it only shows the value in the hover when debugging.

Marc Gravell
You mean I should remember the values of all constants?For me, HPCutoffFrequency is a good name, still that doesn#t tell me the original developer set it to 15.I've actually seen it work sometimes, sometimes not - but I am jumping between PC's and devstudio versions a lot.
peterchen
A: 

Marc,

Yes, I mean const variables. I assume readonly variables are the same way. Perhaps you are right that seeing the actual value of the constants is not absolutely necessary, but it certainly is nice. It makes using constants, which is usually the best practice, a lot easier to do. I am doing spectrum processing with some 30 constants and being able to see the actual values as I am writing code that uses them makes things much more natural for me. I assume the actual values do show up during debugging when you hover over them, but it would be nice to see them in the editor too. If they VB editor can do it, C# should be able to also.

Craig
A: 

I agree with what Marc says about the naming should be self descriptive. However, I work in the medical field, and the exact wording of things are important. I would like for other developers to be able to look at my code and to get the exact text of any string constant just by hovering over it instead of having to cross reference it against it's value in a constants class. Is there any way to configure C# to do this?

It would sure be a lot more helpful than only getting the type (wow, that constant is a string!) with the hover event.