|
-
Nov 18th, 2004, 07:28 AM
#1
Why is C# case sensitive?
I am not having a good time running through a small C# article regarding Automation.
While writing code, I don't want to worry about whether I wrote "int" or "INT". I'd rather focus on achieving something, not making it 'look right'. It's going to be those days of JavaScript again, where I had to spend 15 minutes debugging a large function only to find out that I had misspelt the word textArea. 
Why is C# case sensitive? This is really sad... why didn't they just give VB.NET all the features that C# has to itself exclusively and let us live in peace? Or, if they really wanted something that was close to C/C++/Java, why not allow for case insensitivity? It would be a refreshing change. Just because people have been doing something (dare I say dumb) for 20 years does not mean it should continue. Make a change!!
I actually googled this and came across this article. This has to be the worst excuse I've ever seen:
Perhaps surprisingly to you, we didn't spend a lot of time on this question while designing C#. Rather, we felt that this was clearly a matter that had good arguments on both sides, and was largely a matter of taste, preference, and former experience. Given that, we didn't see a good reason to change from the precedent set by C and C++. In this matter, as with numerous other aspects of the language, such as using curly braces for blocks, ending statements with a semi-colon, the syntax of loop statements, etc. we deliberately chose not to change what C and C++ used. This allowed the basics of the language to be familiar to C and C++ users, so that people can concentrate their attention on a smaller number of features where we felt we could provide significant additional value over C and C++.

I am now going to take a printout of this quote and use it to wipe the grime from underneath my desk.
Last edited by mendhak; Nov 18th, 2004 at 07:43 AM.
-
Nov 18th, 2004, 10:04 AM
#2
I appreciate the rant I was allowed, but can someone explain to me the advantages of case sensitivity?
-
Nov 18th, 2004, 10:25 AM
#3
<?="Moderator"?>
the only advantage i can think if would be having multiple variabes with the same name, even though thats not really the best coding.
-
Nov 18th, 2004, 01:53 PM
#4
Sleep mode
This makes it more challenging , develop accuracy , and more important nobody can call it toy language like VB
-
Nov 19th, 2004, 06:26 PM
#5
I have to agree with mendhak me being a long time Vb coder, found it hard switching to c# witht the case sensitive ....
-
Nov 20th, 2004, 09:13 AM
#6
Mendhak I can see your furstration if you have come from VB background. I have been doing VB for quite a while before moving on to C#. Intially I did some C++ as a result I find C# more elegent then VB.Net specially the OO stuff. I am not saying VB.Net cant do all that just saying C# syntax looks much more elegent in my humble opinion.
As for case sensitivity you have mentioned a good argument about bugs but I have to say i dont get that a lot. The C# comiler is not bad in picking up those mistakes. You just have to get used to it then it wont become an issue.
I do like the case sensetivity, here is why, i can do and always do :
Code:
Contact contact = new Contact();
When i design classes i make then Sentence case where as when i instantiate them i always use lower case.
Now i wouldnt like it any other way since naming contact instead of a new name make the code more readable and slightly elegent.
I am sure these might not be at all an issue to you but I quite like the fact that it is case sensetive. I am sure there are other reason but like its been pointed out it is just matter of preference.
I guess VB has made us all spoilt
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Nov 22nd, 2004, 07:32 AM
#7
I'll agree with that... I'm spoilt thanks to VB.
And I'll mention something else against my case: VB.NET is case sensitive. I depend upon the IDE to correct my capitalization. The other difference being that I can't do something like
Oh well...
-
Nov 22nd, 2004, 09:42 AM
#8
Originally posted by mendhak
I'll agree with that... I'm spoilt thanks to VB.
And I'll mention something else against my case: VB.NET is case sensitive. I depend upon the IDE to correct my capitalization. The other difference being that I can't do something like
Oh well...
Apart from that VB.Net IDE does a lot of neat auto code genaration for us(e.g compleation of If/End If). I havent use VB.Net too much but i am sure there are hundreds more auto completion.
Before you know it, the VB.Net IDE will take control of you and try do all the coding for you 
I bet next version will have
"VB.Net has detected that you are trying to write a n00bi worm! Would like MS VB.Net AutoWorm generator to help write your Worm?"
C# IDE lacks some of these features but I still find C# much more attractive then VB.Net.
Yes, its about time you see the light and join the C# force .
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Nov 22nd, 2004, 03:25 PM
#9
The autocorect variable case thingy was nice in VB. That was the first thing I missed when I moved on to C++. But I have gotten used to it, and don't notice that it is there when I try out some code in VB anymore. But it would probably be easier for those who are comming from VB to C# if it was there. For C/C++ users, there is no diffrence, and we probably woun't kick MS for adding it to the IDE.
ØØ
-
Nov 22nd, 2004, 10:09 PM
#10
I wonder how many charact
Originally posted by mendhak
I'll agree with that... I'm spoilt thanks to VB.
And I'll mention something else against my case: VB.NET is case sensitive. I depend upon the IDE to correct my capitalization. The other difference being that I can't do something like
Oh well...
That will work..
But I agree with you... I don't mind the case sensitivity much, but I certainly do hate the C# IDE in VS 2003. I imagine 2002 was worse, I don't really remember.
Take for instance the lowly form. The VB.Net IDE lists the methods of the form (the class) you are working on. With C#, you have to press TAB key to have it autogenerate event handlers for you. Man, that's just time better spent somewhere else. May only be 2 seconds longer in C#, but times that by 50 classes and holy crap!
And the autocomplete in C# ide leaves much to be desired. I guess the whole argument there is VB is meant for RAD, where C# is meant for elegant design (ahem okayyyyyyy).
However, I will say this about C#, there's nothing more fun than pressing SHIFT and hitting the '[' key before and after your function body. And please, let's remember that only a proper programming language includes a ; at the end of every statement or call.
-
Nov 23rd, 2004, 12:43 AM
#11
Originally posted by nemaroller
However, I will say this about C#, there's nothing more fun than pressing SHIFT and hitting the '[' key before and after your function body. And please, let's remember that only a proper programming language includes a ; at the end of every statement or call.
-
Nov 23rd, 2004, 12:49 AM
#12
Originally posted by Danial
Before you know it, the VB.Net IDE will take control of you and try do all the coding for you 
I bet next version will have
Sandpaper...
Yes, its about time you see the light and join the C# force .
It'$ going to take $omething big to make me $witch over.
-
Nov 23rd, 2004, 12:56 PM
#13
Addicted Member
I've done a lot of vb an java programming over the years an lately I have got into c#. Seeing that it was so much like java it didn't take me long to pick up on it. Anyways, I don't know all the reasons why it was written case-sensitive but from an obvious view it is more common in programming languages to be that way. VB being one of the few that is not. This is just the beginning for C# so sure you will probably find things you do not like about the language or the way it is done in the ide. Heck few years from now MS might not even bother making a visual ide who knows. I personally like the ide tho I do not use it as much as I do with visual basic because I enjoy coding my events an things without letting the ide handle it with its vb like event names and other things. If you are really interested in finding out information about why things are they way they are i would suggest joining one of the msdn scheduled chats on c# or vb.net when they come around and ask the development team some questions about it.
-
Nov 23rd, 2004, 04:46 PM
#14
I wonder how many charact
Tewl,
I agree wholeheartedly with your post at least up until not using an IDE to develop large programs.
I would much rather have the IDE intelligently fill-in the event handlers than force me to recite the same old syntax for the 100th time.
-
Nov 25th, 2004, 09:25 PM
#15
PowerPoster
I found that the VB auto casing your variables was cool when I was working in VB. It helped make sure I wrote it right and gave me visual feedback. BUT, in C# (you can do this in VB as well), I now use something I find much better. That is variable completion. Start typing your variable name, and hit Ctrl-Space. The intellisense window will open if your variable name that you typed so far matches more than one match, but if it doesn't match anything else, it will fill it in for me. Example:
In a C# method, do this:
string myReallyCoolString = "";
then type this:
myR
Hit Ctrl-Space and it will fill in with:
myReallyCoolString
This saves me A LOT of time typing. I hardly ever type out a variable name completely anymore. If you don't use it yet, use it, it will save you a lot of time.
-
Nov 29th, 2004, 03:32 AM
#16
I can imagine the problems all of us would be having if we were given notepad instead of VS.NET.
-
Dec 5th, 2004, 04:31 AM
#17
Addicted Member
Re: Why is C# case sensitive?
I've never used anything but notepad/wordpad when with java. It made me even more aware of my small mistakes such as typos, ect.
-
Dec 29th, 2004, 07:18 PM
#18
New Member
Re: Why is C# case sensitive?
 Originally Posted by mendhak
Why is C# case sensitive? This is really sad... why didn't they just give VB.NET all the features that C# has to itself exclusively and let us live in peace? Or, if they really wanted something that was close to C/C++/Java, why not allow for case insensitivity? It would be a refreshing change. Just because people have been doing something (dare I say dumb) for 20 years does not mean it should continue. Make a change!!
I couldn't agree with you more. It's a known fact that case-sensitivity is a stumbling block, especially for beginners. The creator of Python even admitted this (case-sensitivity) is one of the things wrong with Python (along with int division: where 7/4 = 1 instead of 1.75).
There is no reason why the Microsoft developers could not add a case-insensitive option to the C# compiler (you could turn it on or off however you choose). I implemented a case-insensitive option myself for the boo programming language: http://jira.codehaus.org/browse/BOO-128
I also fixed the int division thing: http://jira.codehaus.org/browse/BOO-208
There is one reason FOR case-sensitivity though, it makes source code a little more readable and standardized. Case-insensitivity though is much more easily writeable than it is less readable.
-
Dec 30th, 2004, 01:34 PM
#19
Frenzied Member
Re: Why is C# case sensitive?
case senative == streangth == not lazy == advantage == frog (base data var for the frog database class) Frog (class you use)
It's not super useful but I think it's better to know what your typing than not.... and things like operator overloading are possible because of all the rules in C#
Face it C# is a dumbed up version of C++ based on the framework. VB is a even dumber version of a powerful language(don't throw stuff at me). VB 6 is like lego block that don't match being put together with a mallet. GPF in subclass.dll....
If this is giving you trouble stick with VB
Last edited by Magiaus; Dec 30th, 2004 at 01:40 PM.
Magiaus
If I helped give me some points.
-
Dec 30th, 2004, 01:36 PM
#20
Frenzied Member
Re: Why is C# case sensitive?
 Originally Posted by hellswraith
I found that the VB auto casing your variables was cool when I was working in VB. It helped make sure I wrote it right and gave me visual feedback. BUT, in C# (you can do this in VB as well), I now use something I find much better. That is variable completion. Start typing your variable name, and hit Ctrl-Space. The intellisense window will open if your variable name that you typed so far matches more than one match, but if it doesn't match anything else, it will fill it in for me. Example:
In a C# method, do this:
string myReallyCoolString = "";
then type this:
myR
Hit Ctrl-Space and it will fill in with:
myReallyCoolString
This saves me A LOT of time typing. I hardly ever type out a variable name completely anymore. If you don't use it yet, use it, it will save you a lot of time.
sweet
Magiaus
If I helped give me some points.
-
Jan 3rd, 2005, 09:24 PM
#21
Dazed Member
Re: Why is C# case sensitive?
Comming from coding in Java for quite a number of years learning C# should pose less of a problem for me than someone comming from Vb but some of C#'s syntax seems a bit weird. Why is a language specific class type such as string defined as lower case and it's methods defined as starting in uppercase?
-
Jan 3rd, 2005, 10:09 PM
#22
Frenzied Member
Re: Why is C# case sensitive?
Because the .net framework is based on Uppercase starting methods and properties.... System.String is simple pointed to by string. string is lowercase because it s more the way things work in C++ System.String the members it provides are uppercase for all .net framework languages.
If I made my own language we'll call it Bob the Builder I could make a string type for my language called bob_string or _string or __bs it would still have the same mebers and member name case as System.String....
For that matter I can make the bob_string type in C# if I wanted to let's say add some extra string methods like Encrypt or something.....
Magiaus
If I helped give me some points.
-
Jan 3rd, 2005, 10:38 PM
#23
Dazed Member
Re: Why is C# case sensitive?
Posted by Magiaus
Because the .net framework is based on Uppercase starting methods and properties....
So i guess C# and Java are opposites in that respect.
Code:
String s = "hello"; // Java
int i = s.length();
string s = "hello";
int i = s.Length(); // I guess C# please correct me if i am wrong
-
Jan 3rd, 2005, 11:12 PM
#24
Frenzied Member
Re: Why is C# case sensitive?
I guess so. There is no String in C++ only char. You have to include a header to get String. When adding a string class to the base language I assume they wanted to keep the convection where int, bool, double, float and so on where already lowercase it only makes since that when adding String it would be string not String.
Magiaus
If I helped give me some points.
-
Jan 3rd, 2005, 11:26 PM
#25
Dazed Member
Re: Why is C# case sensitive?
Posted by Magiaus
When adding a string class to the base language I assume they wanted to keep the convection where int, bool, double, float and so on where already lowercase it only makes since that when adding String it would be string not String.
Yes but sbyte int short ect.... are primative types whereas string is a composite type. I would think that when creating a language you would want to support some type of syntactical differentation.
-
Jan 3rd, 2005, 11:37 PM
#26
Frenzied Member
Re: Why is C# case sensitive?
In the framework they are complex types though. Provinding new and extended functionality. int in C++ is int16 int in C# is int32. All the C# keywords are lower and string is a C# keyword. It's the convection the language takes to hold with C/C++ look at int.Parse and so on the entire language is this way and string is a base part of the language.
At least you don't have to worry with __gc class and all the C++ extras need to use the framework. Casting pointers and so on can be insane in c++ to managed code.
It's all about the framework, the language is up to you. C# has operator overloading. Meaning I can make a collection call the add method by going
Code:
mCustomArray++ object;
if I overloadd the + operator. That's about the biggest thing C# does that say VB doesn't. Or I could make an int class that ++ would subtract.
Magiaus
If I helped give me some points.
-
Jan 3rd, 2005, 11:58 PM
#27
Dazed Member
Re: Why is C# case sensitive?
Posted by Magiaus
look at int.Parse and so on the entire language is this way and string is a base part of the language.
int.Parse just looks to me like an automatic boxing operation for a language that has a lack of wrapper types which then means the type system is unified such that a value of any type can be treated as an object.
Magiaus do you know where i can find C# API documentation? I looked all over microsofts site with no luck. Thank you for the help.
-
Jan 4th, 2005, 01:53 AM
#28
Frenzied Member
Re: Why is C# case sensitive?
Honestly I havent looked into it for a year or two. You have to look into Reflection, Interop, and Marshaling. Basicly you declare the API simular to the way you would in VB6. You have to do this for any structs and so on. It is a bit frustrating. I went as far as making a C++ wrapped .net API lib but I lost the work. I wrapped around 60 of the Win32 API but the deeper I went into the API and the framework the more redundent it got. I can usually find a way without API. Unless I want to do hooks or something.
Truthfully I got to the memory API and my brain melted because CopyMemory was returning the same handle for any framework type a unique handle for each type but the same on every instance. Even if I made like 1,000. I got all dizzy thinking about garbage collection, object instances and I went into a C++ indused comma.
I couldn't think of unified for some reason. That's what it is is a unified type system. As far as the boxxing and unboxxing goes it's beyond me. I gave up on learning C++ until someone is going to pay me to use it....
Magiaus
If I helped give me some points.
-
Jan 4th, 2005, 02:52 PM
#29
Dazed Member
Re: Why is C# case sensitive?
All i wanted was a link to the API.
-
Jan 26th, 2005, 12:36 PM
#30
Frenzied Member
Re: Why is C# case sensitive?
 Originally Posted by Dilenger4
 All i wanted was a link to the API.
Sorry I'm slow. http://msdn.microsoft.com/library/de...start_page.asp
Magiaus
If I helped give me some points.
-
Jan 29th, 2005, 09:27 AM
#31
I wonder how many charact
Re: Why is C# case sensitive?
 Originally Posted by Dilenger4
So i guess C# and Java are opposites in that respect.
Code:
String s = "hello"; // Java
int i = s.length();
string s = "hello";
int i = s.Length(); // I guess C# please correct me if i am wrong
Code:
//C#
String s = "hello";
works just the same as using a lower 'string s'. It creates the same intermediate language instructions.
-
Jan 29th, 2005, 09:30 AM
#32
Frenzied Member
Re: Why is C# case sensitive?
 Originally Posted by nemaroller
Code:
//C#
String s = "hello";
works just the same as using a lower 'string s'. It creates the same intermediate language instructions.
as long and you have
Magiaus
If I helped give me some points.
-
Jan 29th, 2005, 09:33 AM
#33
I wonder how many charact
Re: Why is C# case sensitive?
lol, i suppose, but then you're not getting much written without the system library.
-
Jan 29th, 2005, 10:37 AM
#34
Frenzied Member
Re: Why is C# case sensitive?
I'm just being picky, but I forced myself to not use any using statements for the past year to ingrain the framework into my brain. I think I must be crazy. I know I typed twice as much junk for no reason....
Magiaus
If I helped give me some points.
-
Jan 29th, 2005, 10:59 AM
#35
I wonder how many charact
Re: Why is C# case sensitive?
I've done that too.. .except where I work now... its considered back programming practice (against their defined standards) to use the fully qualified name.. instead of placing a using statement at the top.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|