this post was submitted on 23 Jun 2022
4 points (100.0% liked)

Java™ Community

476 readers
1 users here now

Write once, run anywhere (WORA)

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.

The community

News, Technical discussions, research papers and assorted things of interest related to the Java Platform.

Rules
  1. Follow the Code of Conduct.
  2. Please make sure its a question/topic/post that would be new to most members. In Lemmy the publications are not closed, so you can continue to participate in them, regardless of the time they were published.
  3. Lemmy doesn’t have flags yet, so please tag your posts with [Question], [Help], [Learning], [JVM], [JSE], [OpenJDK], [Eclipse] or other you may think is appropriate.

Related communities

Resources

founded 4 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 2 years ago (1 children)

Interesting analysis, but the conclusion is a bit contrived. People often prefer type safety over performance. When it doesn't impact type safety, they still prefer better performance over worse performance. That's not a contradiction.

You could argue that introducing the EnumSet-type isn't worth it for that, but I don't really see a disadvantage from having it.
Those who know about EnumSet, can use it. Those who don't know it, can continue to use HashSet. And if you don't know about EnumSet, but find one in a code base, it's not hard to guess what it does...

[–] [email protected] 1 points 2 years ago

Yes, the performance of these structures is a concern for low-level computing, but in most cases (where the Java designers focused), they aim to make the developer's work more productive and readable (the responsibility for the efficiency and management of resources is delegated to the VM). Even so, analyzes of this type are important for people focused on the development of JVMs, where efficiency does play a truly critical role.