Question on Primitive Types in Patterns
Brian Goetz
brian.goetz at oracle.com
Fri Sep 5 14:30:06 UTC 2025
>
> I've been giving a presentation on Patterns in the Java language and
> including some puzzles. The recent inclusion of Primitive Types in
> Patterns has provided some interesting material. I currently have one
> puzzle that I can't quite explain; hopefully someone on the mailing
> list can provide clarification.
On a pedagogical note, I'd like to make a case for "Java Puzzlers Talks
Considered Harmful." They can be fun to write (which is why we get so
many of them), but I have found that the vast majority of time, a good
chunk of the audience comes away with notions that are closer to "XYZ is
broken", "XYZ is just all ad-hoc complexity", or "XYZ has no organizing
design principle" -- even though this is rarely the intent of the
presenter (often the opposite, in fact.)
When Josh and Neal started with Puzzlers, they could at least come from
the position of "these were some arguably-mistakes that *we* made". Not
only did this give them credibility that almost no other "Java Puzzlers"
presenter could have, but it pushed them to dig deeper to present
language design tradeoffs _from the perspective of language designers_.
I cannot count the number of times where someone has seen a "puzzler"
presentation or blog, and learned the exact opposite lesson than it was
trying to teach. This is an extraordinarily difficult format for
teaching. Worse, the nature of a "Puzzlers" talk requires having a
bunch of them, and -- even when Josh and Neal did it -- there were
always a few that didn't live up to the standards; the format often
overtakes the message. It is just a truly punishing format, one that
requires world-class pedagogy and impeccable preparation to avoid the
all-too-common outcome where many in the audience learn the wrong lesson
(often reinforcing their preconceived but ill-examined assumptions about
"X is bad.")
More information about the amber-dev
mailing list