In Scala, where var/val both exist, each time you declare a variable you are forced to think about its mutability. But if you only have "var", with the _option_ of tacking "final" to it, then a programmer can simply forget to make that decision, because the language allowed them to.
var i = 0;
final var i = 0;
int i = 0;
final int i = 0;
val i = 0;
One of the options there is a very odd one. And if there was "val", would "final var" be disallowed?So instead of typing:
AbstractConcreteFactoryFactory factory = new AbstractConcreteFactoryFactory();
You can just type it only once: var factory = new AbstractConcreteFactoryFactory();C# is a huge breath of fresh air compared to java largely because of useful type inference. It's easy to make compilers do more work now.
Rust is doing type inference with drastically stronger types, for example.
var p = new Person();
p = 1234; // This will trigger a compile time error`Simple<List<Map<String, Demo>, OtherList<Map<Int, String>>` is a little bit painful.
I use scala and basically most often at least public Methods should (in scala you can omit even that, however some functional libraries need a return type) have a explicit type, which most often is enough.