Link to home
Start Free TrialLog in
Avatar of jasww
jasww

asked on

Visual Studio for C# is infuriating! How to have it not be so annoying?

Hi
I am a VB.net developer and am happy wiith how "smart" visual studio is.  For example, if I type
      If something Then
and press Enter, the environment automatically completes the statement as:
       If something Then

       End If

Similarly, if I type
        dim foo as new collection
and press enter it will correct it to
        Dim foo As New Collection

Similarly with names of methods:  mycollection.add()  is recognised, and converted to mycollection.Add()


In VS 2003, the damn editor is case sensitive and it tells me that it cannot find method add().   Come off it!  Why don't it intellisense the correct method?  Why doesn't it add in braces etc when I type the first part of a statement?


So, how do I make VS for C# less annoying and make it autocomplete my code, like it will for VB?


THanks

JASWW


ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello jasww,

not that i can help with your problem but C# is case sensitive as a language while VB is not

so Foo is different from foo in C# while in VB its not, the compiler thats using the IDE for the nice visual handies like autocomplete takes that into account meaning for VB you have one interpreter and for C# a different one

what the point is i do not know either as this discussion shows
http://blogs.msdn.com/brada/archive/2005/10/28/486215.aspx

bruintje
Avatar of jasww
jasww

ASKER



Well it SHOULD know, because VS knows what methods are available.  If it knows that there is a method called Add() and I typed add(), when I do control-space it should correct it.  Like it does for VB.

How do I make it complete code for me like it does for VB?


How do I make it realise that I have corrected an error?  e.g. when I I chnage .add() to .Add(), the code is still underlined as if it contains an error.  This only goes away when I compile.


How do I make intellisense behave in a less crap way such that if one tiny syntax error has been made, intellisense does not stop working globally?  e.g if there is an error in a totally unrelated line of code, my current line cannot use intellisense.  In VB, VS is cabable of doing this.  

It seems to me that VS 2003 for C# is only half finished.


Any tips?


Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You could upgrade to Visual Studio 2005; a lot of work has been done to IntelliSense (including your issue).
Avatar of jasww

ASKER

Also, intellisense exposes PRIVATE members that are not accessible at runtime (because they are private).  This is just crap.  

Please tell me it's fixed in 2005!
I don't have that problem in VS 2003 NOR in VS 2005
Avatar of jasww

ASKER

Two more really shyte issues:



1.
It won't format spaces correctly:

e.g. If I type
    myint=1;
    myint        =      2;

it should be smart enough to turn this into
    myint = 1;
    myint = 2;
just like it does for VB.


2.
If I make a mistake such as mycollection.add()  it will NOT hightlight this as an error until I try to compile it.  Then it has a blue underline.  Then when I correct it to mycollection.Add(), the underline does not go away until compile time!


How crap is this!





mrichmon , thanks for the tip - coupld you details how to turn this on please?  I cannot see it in the options.

THanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You think C# is bad, you should try C++ !
IMHO the fact that C# doesn't correct whitespace like:

   myint=1;
    myint        =      2;

Is a good thing. It allows you to line things up so they are easier to read.
In my IDE, the C# Express version, the spaces are fixed for you.

This:

    int            i            =                 2

becomes:

    int i = 2;

as soon as I hit the semicolon ";" key.
Avatar of jasww

ASKER

I also want it to enumerate the various options available to me when dealing with an enumeration.

Is it really too mcuh to ask to do:

Public Enum Letters
{
   a,
   b,
   c
}
...
Public Letters Foo;
Foo =


and then have intellisense give me the choice of a, b, or c?  Dammit!
haha, the last thing i would do is call c# syntax crap and make a comparison to VB.  IMO i absolutely hate vb syntax.  

I hate all the typing yo have to do,
I HAAAAAAAAAAATE how it doesnt igore whitespace.
I hate that you can't type _variable name and need something like m_variable.
I hate end if
I hate the overloaded equals sign.

The ignorance of white space can lead to truly beautiful code if done correctly.

That is just a few on the syntax, dont get me started on the language itself, ha.


c# express fixes whitespace?  why on earth? professional & team system i use dont touch.

also so what if it shoes private members.  they are marked that way.  also you should be using a syntax that makes them identifiable in your class.

class A {
     private int _myVar;
     public void Foo() {
          ...
          //here you can easily determine a _myVar is member wide scope and not declared up on method scope.
}

it also makes it quicker to find memberwides using intellisense because you immedialty start with, _ or this._
Avatar of jasww

ASKER

I never said C# syntax was crap.  I took care not to say this.  I don't think it is crap.  I prefer VB, but C# is fine.  
I'm saying VISUAL STUDIO is crap in the way it formats/autocompletes/intellisenses the code compared to how it does so for VB.


VB.net does allow _MyVariable.  Maybe Vb6 doesn't, but I'm not talking about that.

no its fine, my post isnt' intended to be debatefull.  to each his own.

you wrote "
Public Enum Letters
{
   a,
   b,
   c
}
...
Public Letters Foo;
Foo =
"

Well depending no where your saying "Foo = " depends if intellisense wil show.  Public Letters Foo; looks like a field so you either need to delcare it on same line, in constructor or in method.  Im not sure if your already donig that because cant tell from that post.
Also if you do Foo = Letters.  as soon as you hit the . then it will give you a list of possible enumerations

Each setting is individually controlled in the Tools-->Options

You will find a lot more of what you are looking for in VS 2005 than in the options available from VS 2003.  If you are having so much trouble then I would upgrade so that you at least have the more options available...
Avatar of jasww

ASKER

mrichmon
I don't want to have to type
  Foo = Mynamespace.MyClassName.Letters.
in order to be promoted with a, b, or c.  

When using VS to write VB, one just has to type
Foo =
and it will do the rest for you.  VS for C# is FULL of annoying little bits like this, infuriating.
AH but in C# the actual name IS Letters.a

a by itself is NOT the same thing.  Therefore it is only requiring you to type the actual name.  Not the full namespace.
I would say Split

carl_tawn {16651131}
mrichmon {16651277}
Idle_Mind {16651411}