Use of “var” type in variable declaration

How about this… double GetTheNumber() { // get the important number from somewhere } And then elsewhere… var theNumber = GetTheNumber(); DoSomethingImportant(theNumber / 5); And then, at some point in the future, somebody notices that GetTheNumber only ever returns whole numbers so refactors it to return int rather than double. Bang! No compiler errors and … Read more

What is the purpose of a declaration like int (x); or int (x) = 10;

The fact that this rule is applicable in your case is not deliberate: It’s ultimately a result of keeping the grammar simple. There is no incentive to prohibit declarations such as yours, but there are great disincentives to complicate rules, especially if those are intricate as they are. In short, if you don’t want to … Read more

name ‘times’ is used prior to global declaration – But IT IS declared

The global declaration is when you declare that times is global def timeit(): global times # <- global declaration # … If a variable is declared global, it can’t be used before the declaration. In this case, I don’t think you need the declaration at all, because you’re not assigning to times, just modifying it.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)