r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

View all comments

Show parent comments

3

u/ihcn Feb 22 '15

The compiler absolutely must know the type of every variable, because otherwise it couldn't possibly give you a mismatched type error.

-2

u/contantofaz Feb 22 '15

Yes. But it's the work of following the dependency to the original types that must be considered too. In some languages types can be inferred in a lot of places. More so than just local to a function. That extra work is not always advisable. Many languages in the Java ecosystem can share the libraries thanks to the effort that Java put into making the libraries easier to share. But once the library follows the Java standards, they may lose some unique informations as required by some languages in the source-code. Information that could implicitly depend on private types even. So language designers are sometimes skeptical of how much information can be leaked in type inference support.