I think one of the problems of untyped or weakly-typed languages is that they can be difficult to debug or understand somebody else's code.
I'm a fan of strong typing. I doubt that puts me in the majority here.
Edit: I'm simply stating a personal preference here: I think this will decrease the readability of source code. We don't all have to agree.
Edit: I can see how my original comment was poorly worded. I didn't mean to say, "I think this change will make Java less than a strongly-typed language", I meant to say, "I think this change might make Java read like less than a strongly-typed language".
This isn't about changing Java to a weakly typed language, though. Java currently determines types via RHS (with a bit of LHS scanning for the diamond operator). If you instantiate a variable with a concrete type on the RHS, why do you need to declare its type on the LHS as well? You've already stated what you want when you instantiated it.
This is simply syntactic sugar to switch this Map<String, List<Class<?>>> foo = new HashMap<>(); for this var foo = new HashMap<String, List<Class<?>>>();.
You'd think so, but after spending a lot of time with C# during last year or so I find it is OK, especially using reasonably named variables and methods (and the IDE helps when you aren't sure).
Then I was reading some nightmare Java today the poorly named variable I was looking at was defined at top of a 100 line method and I was trying to understand its use at the bottom of said method
74
u/evil_burrito Mar 09 '16 edited Mar 10 '16
I think one of the problems of untyped or weakly-typed languages is that they can be difficult to debug or understand somebody else's code.
I'm a fan of strong typing. I doubt that puts me in the majority here.
Edit: I'm simply stating a personal preference here: I think this will decrease the readability of source code. We don't all have to agree.
Edit: I can see how my original comment was poorly worded. I didn't mean to say, "I think this change will make Java less than a strongly-typed language", I meant to say, "I think this change might make Java read like less than a strongly-typed language".