Is there any options in VS 2005 to better handle case issues in C# (Similar
to VB.Net)? 15 1520
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)?
> 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?
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)?
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)?
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.
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)?
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.
<"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
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.
> 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)?
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)?
> 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)?
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)? >
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)?
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |