Posted: 22nd Jan 2011 14:19
@Kevin Picone

You mean apart from an obvious typo ? - Simply that case sensitivity and implicit declaration do not go together.


Ah, I see. I thought the obvious typo was deliberate.

I agree with your second sentence and have always found implicit typing to be a nuisance and a source of silly errors. Of course explicit typing is a bit of a nuisance too.
Posted: 22nd Jan 2011 14:20
GG - you seem to be suggesting that having construct and conStruct as two distinct variables is a good thing. I would have to say it isn't. It is a VERY bad thing and would be the cause of many errors.

My suggestion removes this problem and forces the user to have different variable names not just different cased version of the same name.
Posted: 22nd Jan 2011 14:29
Sooner or later with camel case you'll encounter the problem I described. My example just wasn't very good.

It is a VERY bad thing and would be the cause of many errors.


Not if you use camel case consistently.

My suggestion removes this problem and forces the user to have different variable names not just different cased version of the same name.


It doesn't - it creates a new problem. If you intended to have two integers, construct and conStruct, (I could think of a better example I'm sure) then your solution would simply replace one of them by the other. If that wasn't what the programmer intended then an error would be introduced. Far better to have the editor merely warn the programmer that they have used two similar names and let the programmer decide whether that was intentional or not.
Posted: 22nd Jan 2011 14:32
Case sensitivity is a must. You need to maintain consistency throughout code, if its not case sensitive then your code isn't necessarily consistent.

Code completion becomes more difficult too, what case should it auto complete your variables? And what if you want to have multiple variables with the same name but different cases?

Most of the people answering these questions have been brain washed into sloppy coding by DBP. I don't understand why half these questions are being asked, as far as I'm concerned anyone with experience in developing commercial systems knows the answer is obvious.
Posted: 22nd Jan 2011 14:34
Yes.
Posted: 22nd Jan 2011 14:35
Since UnrealScript is case-insensitive and the fact that it's the best language in the world, it's only logical to make AppGameKit case-insensitive also.

Code completion becomes more difficult too, what case should it auto complete your variables?


It should complete it in the manner used when declaring the variable in the first place.
Posted: 22nd Jan 2011 14:36
Again you are suggesting the two variable with the same name is a good thing. I can't see any situation where it is.

If that wasn't what the programmer intended then an error would be introduced

The error was introduce by the programmer try to use thsame variable name twice with a different case.

Far better to have the editor merely warn the programmer that they have used two similar names and let the programmer decide

Having a question dialog pop up every time you miss-cased a variable name would be intensely annoying. Surely it is far better to assume that no programmer in his right mind would allow construct and conStruct to exist as two independent variables?

what if you want to have multiple variables with the same name but different cases?

Then you are a very bad programmer that writes code that is not mainainable. Some other programmer trying to maintain your code would be very confused.
Posted: 22nd Jan 2011 14:39
Why would you keep mis-casing something?

Surely it is far better to assume that no programmer in his right mind would allow construct and conStruct to exist as two independent variables?


As I said before, I'm sure a better example could be devised.

Again you are suggesting the two variable with the same name is a good thing


With case sensitivity they wouldn't be the same. Simples.
Posted: 22nd Jan 2011 14:42
Scraggle = goodProgrammer
scraggle = badProgrammer

Is there any confusion there?
Of course there is! Scraggle stills read the same as scraggle to a programmer that is new to your code and he will not thank you at all for introducing such unreadability!
Posted: 22nd Jan 2011 14:44
Is there any confusion there?


Not at all. Who is "scraggle"? Will he or she take offense?
Posted: 22nd Jan 2011 14:47
I get the impression you are arguing with me just for the sake of arguing.
Do you really believe that in a 10000 line piece of code you would instantly see that Scraggle and scraggle refer to entirely different things? Or, as I believe would happen, you would not recognise the difference in case for quite some time.
Posted: 22nd Jan 2011 14:57
If I was using lower camel case then, yes, I'd spot the error immediately.

Similarly if I was using upper camel case.

And, with my suggestion, the editor would warn you that two variables, when uncased, are the same. Let the programmer then decide. The issue of 10000 lines is irrelevant - you only need the warning once.

The point about camel case is that each new appended word is capitalised and there are plenty of words in English which can also be constructed from two quite different words appended together. Camel case with case sensitivity allows you to distinguish the two cases (). So Scraggle/scraggle is a poor example.

I get the impression you are arguing with me just for the sake of arguing.


Not really. I think I've exhausted what I have to say on this though.
Posted: 22nd Jan 2011 14:59
just use _ instead of camel case, sheesh!

construct
con_struct

easy
Posted: 22nd Jan 2011 15:06
Why aren't the proponents of case-insensitivity also suggesting that the compiler build a database of identifiers and run some checks to see which ones were similar enough to clump together, because the user probably intended them to be the same? There is no difference between mixing your case up and spelling your variable incorrectly.
Posted: 22nd Jan 2011 15:18
The issue of 10000 lines is irrelevant - you only need the warning once.

Not if you are maintaining someone else's code.

Scenario 1: You are handed someones 10000 line code and told to debug it.
You see myIntegerVariable and MyIntegerVariable. You are debugging a huge piece of code, it would be very easy to miss the difference.

Scenario 2: Your own code. You have myVar, myvar and MyVar.
One of them is a spaceship object another is the score and the third is screen width.
What does myVar refer to? You need a good memory if you start doing things like that.

Not having multiple variables with the same name is simple coding practice. Scraggle is still scraggle and SCRAGGLE, if they read the same, they should be treated as the same.
Posted: 22nd Jan 2011 15:18
There is no difference between mixing your case up and spelling your variable incorrectly.


My view entirely.
Posted: 22nd Jan 2011 15:24
Since not everyone is in agreement, perhaps the variable case fixing can be an IDE option. That way sensible coders that use verbose names can have their case errors auto-fixed whilst those that prefer ambiguity in their variable names can have it.
Posted: 22nd Jan 2011 15:33
I think the point is, that if you know that the compiler is case sensitive, then there is no ambiguity...

It's perfectly clear that HellOpen and HelloPen are different variables, but if the compiler was case insensitive, it would treat them the same, causing all sorts of problems.
Posted: 22nd Jan 2011 16:44
That's a better example, thanks.
Posted: 22nd Jan 2011 16:54
OK, with that example I can see a reason why you might want to do that. Personally, I think if I found myself in the need to have variables with the 'same' name like hellOpen and helloPen then I would change one of them dramatically to avoid any confusion. Therefore, I would still like the IDE option of auto-case-fix for variables.
Indigo IDE has that option for DBP and I have it set on all the time. I find it very useful.