Why do some newer programming languages almost always have the var keyword and write the type after the variable, for example:
var x int = 12345
var y: Int = 67890
I know that type inference can be implemented in this way, which can be written as follows:
var x = 12345
var y = 67890
so that the compiler treats x as an int type, but can"t it be done without var? Isn"t it easier to read as follows:
int x = 123
int y = 456
// :
x = 123
y = 456
Can"t the compiler recognize x in x = 123
statements as int without var? also ask the boss to solve the problem.