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

8

u/ihcn Feb 22 '15

I think the argument is for compile time type inference, something every modern compiled language has, except java of course. Any IDE will tell you what the type is, without you having to type it out.

0

u/contantofaz Feb 22 '15

Java has thousands of libraries packaged up in jar files. Not many languages have that. Languages sometimes expose libraries in source-code format. With a binary-like format, information could be lost. So languages like Java that make declaring types extremely redundant may help the IDEs with figuring out the types of those variables. :-)

Also, one of the goals they may have had for Java was to make competing implementations compatible. Dumbing down the language may have been an effort to make that less difficult. It seems that even new languages are willing to go in that direction so they can help with multiple implementation goals.

Languages that do a great deal of type inference may end up with only their reference implementations. Although perhaps we shouldn't have blamed the type inferencing as the whole cause of it. I think languages willing to break backward compatibility with every other release may not be too enticing for mainstream use. Hence they ending up with just their reference implementations.

5

u/giuseppemag Feb 22 '15

What sort of argument against type inference is this?!?

Type inference just requires signatures, which should well be present in any precompiled library (linking is otherwise impossible). In principle Java has nothing that would prevent type inference, precisely like var in C#.

-1

u/[deleted] Feb 22 '15

What sort of argument against type inference is this?!?

I'd argue that IDEA's struggle to provide correct and meaningful Scala type information (the best form of type checking can often yield false positives) is a good argument against it.

→ More replies (1)