VS 2005 - Case Sensitivity?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gregory_may

    VS 2005 - Case Sensitivity?

    Is there any options in VS 2005 to better handle case issues in C# (Similar
    to VB.Net)?


  • John Murray

    #2
    Re: VS 2005 - Case Sensitivity?

    Not sure that I understand your question .... C# is, by it's nature case
    sensitive .... so that is not a configurable option ....


    gregory_may wrote:[color=blue]
    > Is there any options in VS 2005 to better handle case issues in C# (Similar
    > to VB.Net)?
    >
    >[/color]

    Comment

    • Gabriel Magaña

      #3
      Re: VS 2005 - Case Sensitivity?

      > Is there any options in VS 2005 to better handle case issues in C#[color=blue]
      > (Similar to VB.Net)?[/color]

      You would not want to do that since writing code of this kind:

      MyType myType = new MyType();

      Is a widespread (and valid, language-wise) practice... Or did I
      misunderstand your question?


      Comment

      • Peter Bromberg [C# MVP]

        #4
        RE: VS 2005 - Case Sensitivity?

        It sounds like what you are asking is "Is there any way I can make the C#
        language be case-insensitive like Visual Basic.NET?"

        The answer is, of course, no, you cannot. C# is case - sensitive,, as is
        C++, Javascript, and the Unix filesystem. That's a good thing!
        Peter

        --
        Co-founder, Eggheadcafe.com developer portal:

        UnBlog:





        "gregory_ma y" wrote:
        [color=blue]
        > Is there any options in VS 2005 to better handle case issues in C# (Similar
        > to VB.Net)?
        >
        >
        >[/color]

        Comment

        • gregory_may

          #5
          Re: VS 2005 - Case Sensitivity?

          Ok, last time I was using VS2003 with C# the editor seemed to get confused
          if I was using different cases (or a typo).

          In VB.Net, the editor can always find the right object (since it doesn't
          care about case).

          Has the Editor improved any to let me better use auto-complete
          (intellisense) on mixed case objects ...or at least help me identify a typo?



          "Peter Bromberg [C# MVP]" <pbromberg@yaho o.nospammin.com > wrote in message
          news:5B34787B-0C56-4A71-A581-21E929C34C30@mi crosoft.com...[color=blue]
          > It sounds like what you are asking is "Is there any way I can make the C#
          > language be case-insensitive like Visual Basic.NET?"
          >
          > The answer is, of course, no, you cannot. C# is case - sensitive,, as is
          > C++, Javascript, and the Unix filesystem. That's a good thing!
          > Peter
          >
          > --
          > Co-founder, Eggheadcafe.com developer portal:
          > http://www.eggheadcafe.com
          > UnBlog:
          > http://petesbloggerama.blogspot.com
          >
          >
          >
          >
          > "gregory_ma y" wrote:
          >[color=green]
          >> Is there any options in VS 2005 to better handle case issues in C#
          >> (Similar
          >> to VB.Net)?
          >>
          >>
          >>[/color][/color]


          Comment

          • Gabriel Magaña

            #6
            Re: VS 2005 - Case Sensitivity?

            Yes, as you start to type, intellisense suggests auto-completions for what
            you are typing, regardless of the casing. If you select an element off the
            list, it is pasted with the correct casing.

            Also, the identifier is colored in black if it could not be found. It is
            greenish-colored if it could be found, so you can see at a glance if the
            class/struct/etc... can be seen by VS.


            Comment

            • Me

              #7
              Re: VS 2005 - Case Sensitivity?

              2 words.. not trying to be mean but it will probably come across that way

              "Program better!"

              Not wanting to care about case is IMHO crazy.. I hate looking through code
              that looks like this:

              int MyID;
              myid=10;
              if(myID > 100)
              mYId = 1;
              else
              myiD++;

              Now that is an extreme example but it kind of shows what I mean. If you
              call something MyID then call it that.

              If you really dont want to worry about case then just use all lower
              letters.. At least all references to the variables would be consistant.

              int myid;
              myid=10;
              if(myid > 100)
              myid = 1;
              else
              myid++;


              Consistancy is rule #1 in my book. No matter what you are talking about.

              "gregory_ma y" <None> wrote in message
              news:OvsEOPVHGH A.3916@TK2MSFTN GP10.phx.gbl...[color=blue]
              > Is there any options in VS 2005 to better handle case issues in C#
              > (Similar to VB.Net)?
              >[/color]


              Comment

              • gregory_may

                #8
                Re: VS 2005 - Case Sensitivity?

                Awesome!

                It felt like my left foot was cut off in VS2003. I refused to use C#
                because the editor was so poorly integrated (compared to VB.NET)..... sounds
                like I can finally start looking at C# again.



                "Gabriel Magaña" <no-spam@no-spam.com> wrote in message
                news:er9OiDWHGH A.2040@TK2MSFTN GP14.phx.gbl...[color=blue]
                > Yes, as you start to type, intellisense suggests auto-completions for what
                > you are typing, regardless of the casing. If you select an element off
                > the list, it is pasted with the correct casing.
                >
                > Also, the identifier is colored in black if it could not be found. It is
                > greenish-colored if it could be found, so you can see at a glance if the
                > class/struct/etc... can be seen by VS.
                >[/color]


                Comment

                • Jon Skeet [C# MVP]

                  #9
                  Re: VS 2005 - Case Sensitivity?

                  <"gregory_may " <None>> wrote:[color=blue]
                  > Awesome!
                  >
                  > It felt like my left foot was cut off in VS2003. I refused to use C#
                  > because the editor was so poorly integrated (compared to VB.NET)..... sounds
                  > like I can finally start looking at C# again.[/color]

                  Actually, that behaviour was in VS 2003 for C# as well. Just hit
                  Ctrl-Space to complete something regardless of case.

                  --
                  Jon Skeet - <skeet@pobox.co m>
                  http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
                  If replying to the group, please do not mail me too

                  Comment

                  • Bruce Wood

                    #10
                    Re: VS 2005 - Case Sensitivity?

                    VS2003 Intellisense also does case-insensitive identifier completion.
                    Problems crop up for me only when I use two identifiers that differ
                    only by case, for example:

                    public class A
                    {
                    private string abcd;
                    ...
                    public string Abcd { get { return this.abcd; } }
                    }

                    within class A, typing "this.abcd" would choose either the field or the
                    property, depending upon which was more often used. I solved the
                    problem simply by changing conventions for naming identifiers.

                    Comment

                    • Mitchell S. Honnert

                      #11
                      Re: VS 2005 - Case Sensitivity?

                      > int MyID;[color=blue]
                      > myid=10;
                      > if(myID > 100)
                      > mYId = 1;
                      > else
                      > myiD++;[/color]
                      The thing is, if this code were written in the case-insensitive VB.NET, the
                      background compiler would change all variations of MyID to match the
                      definition. You'd never see code like that.

                      What *I* hate is seeing two variables names that differ only by the case of
                      a single letter. To me, its more likely to that someone reading this type
                      of code would be mistaken about which variable they were actually looking
                      at.
                      [color=blue]
                      > "Program better!"[/color]
                      The subjective opinion on case-sensitivity has nothing to do with
                      programming "better". There are plenty of programmers on either side of
                      this issue.

                      - Mitchell S. Honnert


                      "Me" <me@home.com> wrote in message
                      news:v72dnfLw0f-3o03enZ2dnUVZ_v 2dnZ2d@comcast. com...[color=blue]
                      >2 words.. not trying to be mean but it will probably come across that way
                      >
                      > "Program better!"
                      >
                      > Not wanting to care about case is IMHO crazy.. I hate looking through code
                      > that looks like this:
                      >
                      > int MyID;
                      > myid=10;
                      > if(myID > 100)
                      > mYId = 1;
                      > else
                      > myiD++;
                      >
                      > Now that is an extreme example but it kind of shows what I mean. If you
                      > call something MyID then call it that.
                      >
                      > If you really dont want to worry about case then just use all lower
                      > letters.. At least all references to the variables would be consistant.
                      >
                      > int myid;
                      > myid=10;
                      > if(myid > 100)
                      > myid = 1;
                      > else
                      > myid++;
                      >
                      >
                      > Consistancy is rule #1 in my book. No matter what you are talking about.
                      >
                      > "gregory_ma y" <None> wrote in message
                      > news:OvsEOPVHGH A.3916@TK2MSFTN GP10.phx.gbl...[color=green]
                      >> Is there any options in VS 2005 to better handle case issues in C#
                      >> (Similar to VB.Net)?
                      >>[/color]
                      >
                      >[/color]


                      Comment

                      • Me

                        #12
                        Re: VS 2005 - Case Sensitivity?

                        I just think of programming as more of an art form.. Creating something
                        usefull that also looks pleasing to the eyes.

                        In the end it is always personal preference on what you do in your own code.
                        I just know that when I look at code I like to see things that are easy to
                        follow and understand.

                        Having multiple variables that are different only by the case is a big no-no
                        in my book as well. The only time this could be considered valid is if it is
                        a parameter of a method.

                        Ex. would be something like this:

                        int UserNumber; // member variable in a class

                        String SetUserNumber(i nt usernumber)
                        {
                        UserNumber = usernumber;
                        }

                        Just my 2 cents I guess..



                        "Mitchell S. Honnert" <news@REMhonner tOVE.com> wrote in message
                        news:OVqmPUeHGH A.3936@TK2MSFTN GP12.phx.gbl...[color=blue][color=green]
                        >> int MyID;
                        >> myid=10;
                        >> if(myID > 100)
                        >> mYId = 1;
                        >> else
                        >> myiD++;[/color]
                        > The thing is, if this code were written in the case-insensitive VB.NET,
                        > the background compiler would change all variations of MyID to match the
                        > definition. You'd never see code like that.
                        >
                        > What *I* hate is seeing two variables names that differ only by the case
                        > of a single letter. To me, its more likely to that someone reading this
                        > type of code would be mistaken about which variable they were actually
                        > looking at.
                        >[color=green]
                        >> "Program better!"[/color]
                        > The subjective opinion on case-sensitivity has nothing to do with
                        > programming "better". There are plenty of programmers on either side of
                        > this issue.
                        >
                        > - Mitchell S. Honnert
                        >
                        >
                        > "Me" <me@home.com> wrote in message
                        > news:v72dnfLw0f-3o03enZ2dnUVZ_v 2dnZ2d@comcast. com...[color=green]
                        >>2 words.. not trying to be mean but it will probably come across that way
                        >>
                        >> "Program better!"
                        >>
                        >> Not wanting to care about case is IMHO crazy.. I hate looking through
                        >> code that looks like this:
                        >>
                        >> int MyID;
                        >> myid=10;
                        >> if(myID > 100)
                        >> mYId = 1;
                        >> else
                        >> myiD++;
                        >>
                        >> Now that is an extreme example but it kind of shows what I mean. If you
                        >> call something MyID then call it that.
                        >>
                        >> If you really dont want to worry about case then just use all lower
                        >> letters.. At least all references to the variables would be consistant.
                        >>
                        >> int myid;
                        >> myid=10;
                        >> if(myid > 100)
                        >> myid = 1;
                        >> else
                        >> myid++;
                        >>
                        >>
                        >> Consistancy is rule #1 in my book. No matter what you are talking about.
                        >>
                        >> "gregory_ma y" <None> wrote in message
                        >> news:OvsEOPVHGH A.3916@TK2MSFTN GP10.phx.gbl...[color=darkred]
                        >>> Is there any options in VS 2005 to better handle case issues in C#
                        >>> (Similar to VB.Net)?
                        >>>[/color]
                        >>
                        >>[/color]
                        >
                        >[/color]


                        Comment

                        • Mitchell S. Honnert

                          #13
                          Re: VS 2005 - Case Sensitivity?

                          > In the end it is always personal preference on what you do in your own[color=blue]
                          > code.[/color]
                          True enough.
                          [color=blue]
                          > I just know that when I look at code I like to see things that are easy to
                          > follow and understand.[/color]
                          So...readabilit y is in the eye of the beholder? ;-) Of course, any
                          programmer is going to agree that easy-to-follow and understandable code is
                          preferable, but objectively what promotes this? You can say that one
                          shouldn't name variables in such a way that case-sensitivity would cause
                          confusion, but in my opinion case-insensitivity naturally promotes
                          easy-to-understand code. There are a near-infinite number of variable names
                          you can use; why risk confusion by, for example, having the private member
                          variable and the public property name be the same except for case?
                          [color=blue]
                          > String SetUserNumber(i nt usernumber)[/color]
                          I think the MS naming standard says to use camelCase for parameter names.
                          userNumber? :-)

                          - Mitchell S. Honnert




                          "Me" <me@home.com> wrote in message
                          news:fZGdnYQdw-_yrEzeRVn-pA@comcast.com. ..[color=blue]
                          >I just think of programming as more of an art form.. Creating something
                          >usefull that also looks pleasing to the eyes.
                          >
                          > In the end it is always personal preference on what you do in your own
                          > code. I just know that when I look at code I like to see things that are
                          > easy to follow and understand.
                          >
                          > Having multiple variables that are different only by the case is a big
                          > no-no in my book as well. The only time this could be considered valid is
                          > if it is a parameter of a method.
                          >
                          > Ex. would be something like this:
                          >
                          > int UserNumber; // member variable in a class
                          >
                          > String SetUserNumber(i nt usernumber)
                          > {
                          > UserNumber = usernumber;
                          > }
                          >
                          > Just my 2 cents I guess..
                          >
                          >
                          >
                          > "Mitchell S. Honnert" <news@REMhonner tOVE.com> wrote in message
                          > news:OVqmPUeHGH A.3936@TK2MSFTN GP12.phx.gbl...[color=green][color=darkred]
                          >>> int MyID;
                          >>> myid=10;
                          >>> if(myID > 100)
                          >>> mYId = 1;
                          >>> else
                          >>> myiD++;[/color]
                          >> The thing is, if this code were written in the case-insensitive VB.NET,
                          >> the background compiler would change all variations of MyID to match the
                          >> definition. You'd never see code like that.
                          >>
                          >> What *I* hate is seeing two variables names that differ only by the case
                          >> of a single letter. To me, its more likely to that someone reading this
                          >> type of code would be mistaken about which variable they were actually
                          >> looking at.
                          >>[color=darkred]
                          >>> "Program better!"[/color]
                          >> The subjective opinion on case-sensitivity has nothing to do with
                          >> programming "better". There are plenty of programmers on either side of
                          >> this issue.
                          >>
                          >> - Mitchell S. Honnert
                          >>
                          >>
                          >> "Me" <me@home.com> wrote in message
                          >> news:v72dnfLw0f-3o03enZ2dnUVZ_v 2dnZ2d@comcast. com...[color=darkred]
                          >>>2 words.. not trying to be mean but it will probably come across that way
                          >>>
                          >>> "Program better!"
                          >>>
                          >>> Not wanting to care about case is IMHO crazy.. I hate looking through
                          >>> code that looks like this:
                          >>>
                          >>> int MyID;
                          >>> myid=10;
                          >>> if(myID > 100)
                          >>> mYId = 1;
                          >>> else
                          >>> myiD++;
                          >>>
                          >>> Now that is an extreme example but it kind of shows what I mean. If you
                          >>> call something MyID then call it that.
                          >>>
                          >>> If you really dont want to worry about case then just use all lower
                          >>> letters.. At least all references to the variables would be consistant.
                          >>>
                          >>> int myid;
                          >>> myid=10;
                          >>> if(myid > 100)
                          >>> myid = 1;
                          >>> else
                          >>> myid++;
                          >>>
                          >>>
                          >>> Consistancy is rule #1 in my book. No matter what you are talking about.
                          >>>
                          >>> "gregory_ma y" <None> wrote in message
                          >>> news:OvsEOPVHGH A.3916@TK2MSFTN GP10.phx.gbl...
                          >>>> Is there any options in VS 2005 to better handle case issues in C#
                          >>>> (Similar to VB.Net)?
                          >>>>
                          >>>
                          >>>[/color]
                          >>
                          >>[/color]
                          >
                          >[/color]


                          Comment

                          • Me

                            #14
                            Re: VS 2005 - Case Sensitivity?

                            Doh!!! My bad! :-)


                            "Mitchell S. Honnert" <news@REMhonner tOVE.com> wrote in message
                            news:OvQWp9fHGH A.3916@TK2MSFTN GP10.phx.gbl...[color=blue]
                            >[color=green]
                            >> String SetUserNumber(i nt usernumber)[/color]
                            > I think the MS naming standard says to use camelCase for parameter names.
                            > userNumber? :-)
                            >
                            > - Mitchell S. Honnert
                            >
                            >
                            >
                            >
                            > "Me" <me@home.com> wrote in message
                            > news:fZGdnYQdw-_yrEzeRVn-pA@comcast.com. ..[color=green]
                            >>I just think of programming as more of an art form.. Creating something
                            >>usefull that also looks pleasing to the eyes.
                            >>
                            >> In the end it is always personal preference on what you do in your own
                            >> code. I just know that when I look at code I like to see things that are
                            >> easy to follow and understand.
                            >>
                            >> Having multiple variables that are different only by the case is a big
                            >> no-no in my book as well. The only time this could be considered valid is
                            >> if it is a parameter of a method.
                            >>
                            >> Ex. would be something like this:
                            >>
                            >> int UserNumber; // member variable in a class
                            >>
                            >> String SetUserNumber(i nt usernumber)
                            >> {
                            >> UserNumber = usernumber;
                            >> }
                            >>
                            >> Just my 2 cents I guess..
                            >>
                            >>
                            >>
                            >> "Mitchell S. Honnert" <news@REMhonner tOVE.com> wrote in message
                            >> news:OVqmPUeHGH A.3936@TK2MSFTN GP12.phx.gbl...[color=darkred]
                            >>>> int MyID;
                            >>>> myid=10;
                            >>>> if(myID > 100)
                            >>>> mYId = 1;
                            >>>> else
                            >>>> myiD++;
                            >>> The thing is, if this code were written in the case-insensitive VB.NET,
                            >>> the background compiler would change all variations of MyID to match the
                            >>> definition. You'd never see code like that.
                            >>>
                            >>> What *I* hate is seeing two variables names that differ only by the case
                            >>> of a single letter. To me, its more likely to that someone reading this
                            >>> type of code would be mistaken about which variable they were actually
                            >>> looking at.
                            >>>
                            >>>> "Program better!"
                            >>> The subjective opinion on case-sensitivity has nothing to do with
                            >>> programming "better". There are plenty of programmers on either side of
                            >>> this issue.
                            >>>
                            >>> - Mitchell S. Honnert
                            >>>
                            >>>
                            >>> "Me" <me@home.com> wrote in message
                            >>> news:v72dnfLw0f-3o03enZ2dnUVZ_v 2dnZ2d@comcast. com...
                            >>>>2 words.. not trying to be mean but it will probably come across that
                            >>>>way
                            >>>>
                            >>>> "Program better!"
                            >>>>
                            >>>> Not wanting to care about case is IMHO crazy.. I hate looking through
                            >>>> code that looks like this:
                            >>>>
                            >>>> int MyID;
                            >>>> myid=10;
                            >>>> if(myID > 100)
                            >>>> mYId = 1;
                            >>>> else
                            >>>> myiD++;
                            >>>>
                            >>>> Now that is an extreme example but it kind of shows what I mean. If
                            >>>> you call something MyID then call it that.
                            >>>>
                            >>>> If you really dont want to worry about case then just use all lower
                            >>>> letters.. At least all references to the variables would be consistant.
                            >>>>
                            >>>> int myid;
                            >>>> myid=10;
                            >>>> if(myid > 100)
                            >>>> myid = 1;
                            >>>> else
                            >>>> myid++;
                            >>>>
                            >>>>
                            >>>> Consistancy is rule #1 in my book. No matter what you are talking
                            >>>> about.
                            >>>>
                            >>>> "gregory_ma y" <None> wrote in message
                            >>>> news:OvsEOPVHGH A.3916@TK2MSFTN GP10.phx.gbl...
                            >>>>> Is there any options in VS 2005 to better handle case issues in C#
                            >>>>> (Similar to VB.Net)?
                            >>>>>
                            >>>>
                            >>>>
                            >>>
                            >>>[/color]
                            >>
                            >>[/color]
                            >
                            >[/color]


                            Comment

                            • gregory_may

                              #15
                              Re: VS 2005 - Case Sensitivity?

                              Is there any plug-in or macro or option for the a case crippled programmer?

                              It would be nice to see a warning if two variables show up with differing
                              case. This is my biggest timewaster when using C#.

                              I respect all the folks that really find the below code an art form (I might
                              think your crazy, but I respect your opinions), but for me its just
                              silliness that VS cant help me keep this from happening.


                              "Mitchell S. Honnert" <news@REMhonner tOVE.com> wrote in message
                              news:OVqmPUeHGH A.3936@TK2MSFTN GP12.phx.gbl...[color=blue][color=green]
                              >> int MyID;
                              >> myid=10;
                              >> if(myID > 100)
                              >> mYId = 1;
                              >> else
                              >> myiD++;[/color]
                              > The thing is, if this code were written in the case-insensitive VB.NET,
                              > the background compiler would change all variations of MyID to match the
                              > definition. You'd never see code like that.
                              >
                              > What *I* hate is seeing two variables names that differ only by the case
                              > of a single letter. To me, its more likely to that someone reading this
                              > type of code would be mistaken about which variable they were actually
                              > looking at.
                              >[color=green]
                              >> "Program better!"[/color]
                              > The subjective opinion on case-sensitivity has nothing to do with
                              > programming "better". There are plenty of programmers on either side of
                              > this issue.
                              >
                              > - Mitchell S. Honnert
                              >
                              >
                              > "Me" <me@home.com> wrote in message
                              > news:v72dnfLw0f-3o03enZ2dnUVZ_v 2dnZ2d@comcast. com...[color=green]
                              >>2 words.. not trying to be mean but it will probably come across that way
                              >>
                              >> "Program better!"
                              >>
                              >> Not wanting to care about case is IMHO crazy.. I hate looking through
                              >> code that looks like this:
                              >>
                              >> int MyID;
                              >> myid=10;
                              >> if(myID > 100)
                              >> mYId = 1;
                              >> else
                              >> myiD++;
                              >>
                              >> Now that is an extreme example but it kind of shows what I mean. If you
                              >> call something MyID then call it that.
                              >>
                              >> If you really dont want to worry about case then just use all lower
                              >> letters.. At least all references to the variables would be consistant.
                              >>
                              >> int myid;
                              >> myid=10;
                              >> if(myid > 100)
                              >> myid = 1;
                              >> else
                              >> myid++;
                              >>
                              >>
                              >> Consistancy is rule #1 in my book. No matter what you are talking about.
                              >>
                              >> "gregory_ma y" <None> wrote in message
                              >> news:OvsEOPVHGH A.3916@TK2MSFTN GP10.phx.gbl...[color=darkred]
                              >>> Is there any options in VS 2005 to better handle case issues in C#
                              >>> (Similar to VB.Net)?
                              >>>[/color]
                              >>
                              >>[/color]
                              >
                              >[/color]


                              Comment

                              Working...