Posts
293
Comments
27
Trackbacks
206
VS 2005 and static methods

OK, here's my gripe today. I'm writing a class in C# that has static methods, so I type:

public stat

and IntelliSense pops up. But it doesn't have static as an option at this point, so you have to cancel the IntelliSense window. You can't even type the full word static because it still insists on 'helping', converting static to StaticParticalCachingControl, which I'm sure is a wonderful thing, but not quite what I'm after. In C# 2.0 you can have static classes, which enforces the static on each method. Personally I'd rather have had this mean that methods are automatically static, altough I do think that would have reduced readability as you woudn't know that the method was static unless you looked at the class definition.

[Listening to: You Do - Aimee Mann - Magnolia [Original Soundtrack]]
posted on Tuesday, December 06, 2005 11:26 AM Print
Comments
# re: VS 2005 and static methods
Julie LErman
12/6/2005 1:26 PM
hah! this happened to me a few too many times when I was doing demos at TechEd South Africa. Not happy-making...
# Re: VS 2005 and static methods
James Hart
12/6/2005 2:21 PM
This causes me no end of strife and pain when coding 'consumer first' - writing code that uses classes and methods that I haven't yet written. Intellisense wants to help, but it can't read my mind, and substitutes all manner of classes and methods for the ones I was trying to type. In these circumstances, undo is your friend. When you type 'static', and VS decides you mean 'StaticPartialCachingControl', hit control Z to restore the code you actually typed.
Comments have been closed on this topic.