News for hackers. Stuff that matters.
Re:Java Virtual Threads Preview by jrh206 on Tuesday November 16, 2021 @01:08AM (#29237435)
I really hope they change this `Thread.ofVirtual()` and `Thread.ofPlatform()` language; it sounds clunky and doesn't read like any Java that I've seen before.
Re:Java Virtual Threads Preview by Twisol on Tuesday November 16, 2021 @02:00AM (#29237710)
`Optional.of`, `List.of`, `Set.of`, `Map.of` (and `Map.ofEntries`), ...; this language is actually pretty settled into the JDK.
Re:Java Virtual Threads Preview by elygre on Tuesday November 16, 2021 @02:12AM (#29237768)
https://blog.joda.org/2011/08/common-java-method-names.html?... has some background into the logic of static factory naming, covering from() and of().
Re:Java Virtual Threads Preview by ljnelson on Tuesday November 16, 2021 @01:59AM (#29237706)
Indeed. “of” infected Java with the awful naming conventions imposed by java.time (and to a lesser degree java.nio) because “new” is a keyword and doing “newThing” instead was not in vogue. Now it smacks of the worst kind of hipster disease and is going to enter java.lang for no good reason at all. What’s wrong with “newPlatformThread” or something similar? This shouldn’t have survived the initial sniff test.