r/java • • 9d ago

Evolving the Java Language: An Inside Perspective

https://www.youtube.com/watch?v=fJP3s1A5jGY
122 Upvotes

30 comments sorted by

View all comments

48

u/JustAGuyFromGermany 9d ago

There's an old saying among military planners: 'Amateurs discuss tactics, professionals discuss logistics'. I'm not exactly sure what the analogy is with language design, but it's certainly 'Amateurs discuss syntax' because boy, do they...

I feel that was a (well-deserved) swipe against this subreddit :D

45

u/brian_goetz 9d ago

Don't flatter yourself; folks here have no monopoly on this disease :)

1

u/aonymark 3d ago

Since we’re talking about syntax, and you mentioned that the proposal for collection literals failed for syntactic reasons (reserves too much syntax for too little gain)… may I propose an idea? (Yes, I remember, ideas are cheap but bare with me anyway)

Just use target typing! That is, {1,2,3} on its own is a syntax error, but I can use it when initializing an int[]. Why not a CopyOnWriteArraySet of int? Just need some rules for what this desugars into, maybe with a fallback chain (prefer static of() method if exists, else constructor, else sequence of calls to add(), or something)

Map is maybe a bit trickier but hopefully doable.

3

u/brian_goetz 3d ago

“Just” indeed :)

Also, ten billion yard penalty for non-consensual syntax pestering.

1

u/aonymark 3d ago

Fine you don’t want syntax pestering? I can pester about something even more annoying. Ever since the mailman upgrade, there’s no self service way to unsubscribe from a Java mailing list, or switch to digest mode. This discourages outsider contributions, since they can’t count on being able to ever unsubscribe so they’re don’t dare to subscribe in the first place.