473,230 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

VS 2005 - Case Sensitivity?

Is there any options in VS 2005 to better handle case issues in C# (Similar
to VB.Net)?
Jan 20 '06 #1
15 1514
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:
Is there any options in VS 2005 to better handle case issues in C# (Similar
to VB.Net)?

Jan 20 '06 #2
> Is there any options in VS 2005 to better handle case issues in C#
(Similar to VB.Net)?


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?
Jan 20 '06 #3
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_may" wrote:
Is there any options in VS 2005 to better handle case issues in C# (Similar
to VB.Net)?

Jan 20 '06 #4
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]" <pb*******@yahoo.nospammin.com> wrote in message
news:5B**********************************@microsof t.com...
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_may" wrote:
Is there any options in VS 2005 to better handle case issues in C#
(Similar
to VB.Net)?

Jan 20 '06 #5
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.
Jan 20 '06 #6
Me
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_may" <None> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
Is there any options in VS 2005 to better handle case issues in C#
(Similar to VB.Net)?

Jan 20 '06 #7
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*****@no-spam.com> wrote in message
news:er**************@TK2MSFTNGP14.phx.gbl...
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.

Jan 20 '06 #8
<"gregory_may" <None>> wrote:
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.


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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 20 '06 #9
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.

Jan 20 '06 #10
> 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:v7******************************@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_may" <None> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
Is there any options in VS 2005 to better handle case issues in C#
(Similar to VB.Net)?


Jan 20 '06 #11
Me
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(int usernumber)
{
UserNumber = usernumber;
}

Just my 2 cents I guess..

"Mitchell S. Honnert" <ne**@REMhonnertOVE.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
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:v7******************************@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_may" <None> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
Is there any options in VS 2005 to better handle case issues in C#
(Similar to VB.Net)?



Jan 20 '06 #12
> In the end it is always personal preference on what you do in your own
code. True enough.
I just know that when I look at code I like to see things that are easy to
follow and understand. So...readability 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?
String SetUserNumber(int usernumber) 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:fZ********************@comcast.com...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(int usernumber)
{
UserNumber = usernumber;
}

Just my 2 cents I guess..

"Mitchell S. Honnert" <ne**@REMhonnertOVE.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
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:v7******************************@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_may" <None> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
Is there any options in VS 2005 to better handle case issues in C#
(Similar to VB.Net)?



Jan 20 '06 #13
Me
Doh!!! My bad! :-)
"Mitchell S. Honnert" <ne**@REMhonnertOVE.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
String SetUserNumber(int usernumber)

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:fZ********************@comcast.com...
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(int usernumber)
{
UserNumber = usernumber;
}

Just my 2 cents I guess..

"Mitchell S. Honnert" <ne**@REMhonnertOVE.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
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:v7******************************@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_may" <None> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
> Is there any options in VS 2005 to better handle case issues in C#
> (Similar to VB.Net)?
>



Jan 20 '06 #14
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" <ne**@REMhonnertOVE.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
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:v7******************************@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_may" <None> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
Is there any options in VS 2005 to better handle case issues in C#
(Similar to VB.Net)?



Feb 2 '06 #15
I believe that FxCop warns about things like this.

You can download FxCop for free from Microsoft, if you don't have it
already. I also heard rumours that it was built into VS2005, although I
don't know for sure.

Feb 3 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some...
761
by: Neo-LISPer | last post by:
Hey Recently, I researched using C++ for game programming and here is what I found: C++ game developers spend a lot of their time debugging corrupted memory. Few, if any, compilers offer...
16
by: Starwiz | last post by:
I'm a VB.net programmer, and I'm about to start working with two C++ programmers and teach them .net. I've decided to use C# in teaching them, since it's similar enough to VB.net that I can read...
3
by: Jason Tesser | last post by:
I am converting data from Access into Postgres and ran into an issue with case sensitivity. Can I write queries in Access that will be case insensitive without rewriting the queries. So I would...
14
by: Christian Sell | last post by:
Hello, I am running into a problem with PGs case sensitivity with regard to column and table names. I am using program components that require the object names returned from database metadata...
1
by: othellomy | last post by:
Is SQL server defaults to case insensitive? I am sure there are ways to install case sensitive SQL server instance but coming from Sybase (which is always case sensitive) case insensitivity is...
3
by: Anita Potekkat | last post by:
Hello, I had a question regarding Case Sensitivity in 10g & 9i. (1) Does Case Sensitivity in Oracle have to do with data only? Or does it also effect table & column names? For e.g. in a table...
2
by: sweetpotatop | last post by:
Hi, I believe my SQL server was configured as Case sensitivity. I have a number of stored procedures which were moved from a non-Case sensitivity SQL server. Because of the Case sensitivity, I...
2
by: Lucky | last post by:
Hi guys, I'm having problem with case sensitive collation of SQL Database. one my client is having case sensitive database. While developing the Data Layer i didn't consider this scenario. the...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.