Take the 2-minute tour ×

I am using VB.NET and C#, and VB.NET is really friendly regarding suggestions and formatting. It formats my lines nicely, even if I accidentally forgot to tab a line to indent it, it adds braces automatically, when I forget it and other things that make my life easier.

The C# IDE however is really rigid and not friendly. For example I wrote "Mess", hit space, thinking it would automatically choose MessageBox, then I simply added "Some text" and hit Enter, and it became

 Message "Some Text

The autosuggestion was not quick enough to scroll to "MessageBox", so it became "Message".

It also did not automatically add braces.

Perhaps I am asking for too much, but is there maybe an option to correct my code? I like C# a lot, but entering code could be a little easier and less time taking.

Even if I get used to doing it correctly, it still makes a difference to me if I have to enter 10 keys to get correct results or 20.

share|improve this question

closed as not constructive by Erik Philips, Ed S., marc_s, Yasser, Alvin Wong Feb 22 '13 at 6:58


so, what do you want here ? –  Yasser Feb 22 '13 at 6:38

2 Answers 2

up vote 2 down vote accepted

The Visual Studio Features are self learning. When you type "Mess" it tries to find what you meant. In C# (and I guess in VB, too) there are multiple keywords and classes starting with "Mess" so it picks the first. The more you use this feature to pick things other than the first (like always picking MessageBox from the list that pops up when you enter "Mess") the more this will become the default. Try to go slow and pick MessageBox from the list a few times and Intellisense will suggest MessageBox as the default next time.

Indentation is checked and corrected when you close a brace. If you need a reformat, the fastest way is deleting and re-entering the closing brace for whatever scope you want formatted.

As for braces, you will have to set them yourself. There are tools like R# that will do this for you, but the good ones cost money.

share|improve this answer
Ah, okay, thank you. I didn't know it was self-learning. That really solved the main problem. –  tmighty Feb 22 '13 at 6:49

You can tweak InteliSense to possibly work a little bit better for you (see here), and it will get smarter the more you use it, but aside from showing a list of options that are available for the current variable/object or automatically adding a closing brace or quote, you will never get it to read your mind.

Tools like ReSharper can also help, but even the good ones require configuration and cost money (sometimes quite a bit).

share|improve this answer
