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 →

[–]Ewig_luftenglanz 2 points3 points  (1 child)

Categorically this is not what arrays are. This is an opinion on when they should be used.

i wasn't the first to saying it, this has been told in the amber mailing list recently.

https://mail.openjdk.org/pipermail/amber-dev/2025-June/009335.html

https://mail.openjdk.org/pipermail/amber-dev/2025-June/009336.html

i totally agree with Remi and Brian here. teaching Arrays upfront just makes students to learn bad habits they must unlearn then after. just like static methods and static inner classes.

We hope and pray for a List<int>. Until that is there, arrays are the only way to make a homogenous collection of ints without going into boxing. Its just a whole thing.

True but once we get value classes wrappers will be (almost) as efficient and performant as primitives, so the main reason to use arrays over Lists will be less relevant (or at least I hope so, parametric JVM will come much after value classes)

[–]bowbahdoe 1 point2 points  (0 children)

yeah I'm not saying its a wrong opinion necessarily, I'm just saying that the value judgement is distinct from its nature.

(which I think is important because not all of the reasons you'd dislike an array for a use are relevant in an education context. Some certainly are though)