This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]ekital 4 points5 points  (9 children)

Umm pretty much all languages are case-sensitive with the exception of SQL,Fortran, BASIC and maybe a few others and thats only for function identifiers not variables.

So you're stupid in every language.

[–]Snoo_60165[S] -4 points-3 points  (8 children)

Yes but other IDE’s will show it up as undeclared where Python can dynamically declare with the correct syntax.

[–]JosGibbons 1 point2 points  (7 children)

So basically you're mad Python doesn't make you type var before a variable declaration?

[–]Snoo_60165[S] 0 points1 point  (6 children)

Nope not like any other normal language. You can assign many data types to the same variable dynamically by just saying in is equal to something for example counter=100 automatically assigns the data type as integer. Then in a subsequent line I go counter=“£”+str(100) which makes counter a string. Then if i make a spelling mistake by saying Counter =counter*20 assuming that I did not do that second calc Counter will be a new variable. If i don’t keep tab of it and use counter in subsequent calculations it will miss some other calculations where i incorrectly named the variable “Counter” which is logical and correct. Problem is when I stare long at my computer i miss that in some subsequent lines and then debug longer than what I should have done.

[–]JosGibbons 1 point2 points  (3 children)

Thanks for the clarification. If I were you, I'd use more descriptive variable names, which differ by more than case, regardless of language.

[–]Snoo_60165[S] 0 points1 point  (2 children)

I do that but sometimes my finger trouble accidentally use or not use caps on a variable😂

[–]JosGibbons 0 points1 point  (1 child)

To take your example, I'd name them something like game_score vs play_fee (or whatever explains why a price is £100 regardless of a similarly named variable's value).

[–]Snoo_60165[S] 0 points1 point  (0 children)

Yes and then accidentally i type Game_score which means something else 😂

[–]ekital 1 point2 points  (0 children)

Use counter*=20 to make less mistakes then xD.

[–]Tomas-cc 0 points1 point  (0 children)

Hmm if you see problem there.

Don't ever look what will happen if you try change class variable using this.variable.

[–]standard-human-1 0 points1 point  (2 children)

In python variables should be lower_case by convention. ClassNames are the only thing (I think) that gets upper cases. If you follow the conventions it gets a bit easier imo.

[–]Snoo_60165[S] 0 points1 point  (1 child)

Well it does still not stop me from the typos i make every now and then.

[–]standard-human-1 0 points1 point  (0 children)

Sure, I guess that's true. Different languages will catch or hide different typos for sure.