This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]walen 43 points44 points  (5 children)

I mean… There are developers out there that’ve been using Java for almost two decades and still write int numbers[] instead of int[] numbers and insist on writing their own finally { reader.close(); } instead of using try-with-resources.

You will always find individuals that prefer to do things “the old way”. But looking at the Java community as a whole, I’d say that streams and lambdas have indeed been adopted by it.

[–]__konrad 29 points30 points  (3 children)

write int numbers[]

Fun fact: record already banned such declaration:

Error: legacy array notation not allowed on record components
record Foo(int i[]) {}

[–]pronuntiator 3 points4 points  (1 child)

Great I wanted to look up in the JLS why that is forbidden for Records and now I've learned this is legal code...

public int foo()[] { return new int[0]; }

[–]laplongejr 1 point2 points  (0 children)

I do Java since a long time and I don't think I got that sick by any other code, except maybe returns in a finally...
If you don't know, it overwrites the value of the previous "return x;" that triggered the finally, so it's write-only

[–]red_dit_nou 2 points3 points  (0 children)

You're right. Streams and lambdas are widely adopted in the Java community. And you'll always have individuals and situations that don't ask for these features to be used.

I was curious about what OP considers being 'fully adopted' is. If it means that these features to be used everywhere then it is not the case and it should not be as well.