• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 378
  • Last Modified:

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


0
jasww
Asked:
jasww
  • 6
  • 5
  • 3
  • +4
3 Solutions
 
Carl TawnSystems and Integration DeveloperCommented:
Purely because it is case sensitive. add() and Add() as far as C# is concerned are two different things. IntelliSense doesn't know that you meant Add().
0
 
bruintjeCommented:
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
0
 
jaswwAuthor Commented:


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
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
mrichmonCommented:
You cannot get most errors to go away until you compile.

However, you can solve some of your other issues.  In the options there are options for code finishing/rew-writing.  You have to turn on/off the settings until it behaves more in the manner you desire.  It took our office quite a bit of custimizing and we now have a list for any new people of common customizations we make in VS to get it to "behave properly"

You can set many settings per language.

It is not VS's fault that you are used to VB which is not case sensitive and are trying to use C# which is.  In general I treat all languages as case sensitive, then you have better results transitioning between languages.

If you think VS 2003 is only half finished try VS 2005 - it has some things better and others WORSE!!!

However, intellisense is greatly improved in VS 2005.  Maybe you should try that.  Additionally it color codes custom objects as they are used so you can see right away if they are recognized.  That may make things easier for you.  VS 2005 also has code snippets which do the "if-then" thing you are asking for.

Hope that helps.
0
 
Expert1701Commented:
You could upgrade to Visual Studio 2005; a lot of work has been done to IntelliSense (including your issue).
0
 
jaswwAuthor Commented:
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!
0
 
mrichmonCommented:
I don't have that problem in VS 2003 NOR in VS 2005
0
 
jaswwAuthor Commented:
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
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
VS2005 does have a better IDE.

In most cases it will autocorrect your upper/lower case issues for you.

You can type in "if" and then hit the Tab key and it will put in the braces for you.

You can also Right Click, select "Insert Snippet" and then choose from a ton of pre-defined code snippets such as:

            try
            {

            }
            catch (Exception)
            {
               
                throw;
            }

etc...etc...
0
 
Carl TawnSystems and Integration DeveloperCommented:
You think C# is bad, you should try C++ !
0
 
Carl TawnSystems and Integration DeveloperCommented:
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.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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.
0
 
jaswwAuthor Commented:
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!
0
 
devsolnsCommented:
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._
0
 
jaswwAuthor Commented:
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.

0
 
devsolnsCommented:
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.
0
 
mrichmonCommented:
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...
0
 
jaswwAuthor Commented:
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.
0
 
mrichmonCommented:
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.
0
 
mrichmonCommented:
I would say Split

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 5
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now