r/java • • 7d ago

Evolving the Java Language: An Inside Perspective

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

29 comments sorted by

View all comments

47

u/JustAGuyFromGermany 6d 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 6d ago

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

1

u/aonymark 1d 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.

2

u/brian_goetz 1d ago

“Just” indeed :)

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

1

u/aonymark 20h 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.

5

u/simon_o 3d ago

To be honest, this pseudo-intellectual "hur dur syntax does not matter" is a bit overdone these days.

Syntax is the UI of programming. It absolutely matters.

Asking "how do I want users to express this concept?" is an important part of good language design.

-8

u/mipo256 6d ago

Well, you have to admit that a lot of people still for some reason care about the exact syntax details and with the straight face discuss that as one of the reasons to prefer one language over the other.

That is insane, considring the fact that AI now writes a lot of code.