r/programming • • Mar 09 '16

var keyword proposed for Java

http://openjdk.java.net/jeps/286
250 Upvotes

395 comments sorted by

View all comments

Show parent comments

24

u/eras Mar 09 '16

Though of course, this is not dynamic typing :).

-1

u/probablytaken1 Mar 09 '16

Oh i know it's type inference. But I was alluding to more, such as lambdas as well. Every language seems like they all want to do the same things.

7

u/simspelaaja Mar 09 '16

Because they are obviously good ideas? There's no reason not to have type inference and lambdas (in a language higher level than Assembly).

3

u/Berberberber Mar 09 '16

Compilers generate assembly-lambdas all the time; they're call inline functions. :)

1

u/[deleted] Mar 09 '16

[removed] — view removed comment

4

u/immibis Mar 10 '16

If you need a zero-allocation design then Java is not the language for you.

3

u/simspelaaja Mar 09 '16

Sure, but that doesn't mean they shouldn't be supported at the language level.

2

u/danneu Mar 09 '16

They should give us good abstractions that help us solve problems with the least amount of ceremony. Anonymous functions are too useful to pass up.

1

u/damienjoh Mar 10 '16

Because these are basic language features that aren't specific to JS, have been around for longer than JS and are also found in most modern languages?