Small feedback from LJC talk
Brian Goetz
brian.goetz at oracle.com
Tue May 29 22:38:34 UTC 2018
Thanks for these thoughts. Some counter-thoughts:
> Expression Switch
> -------------------------
> It was commented that I ended up taking half the talk on this - it
> seemed to drag for me too. the problem is that there are now 4
> different types of switch, and expressing the inherent complexity to
> gain understanding is not simple.
Yeah, I think its probably overkill to try and explain all the details
at this level all at once to an audience that has never seen any of it
before. I could imagine it being hard to keep track of the cases when
presented this way.
The takeaway I'd be after with this audience is:
- Does your switch effectively calculate a value? Then use the
expression form, you don't have to break, and you automatically get
exhaustiveness checking (which is even better for enums!)
- Does your switch need fallthrough? No? Then use the arrow form,
its simpler and its what you want to say anyway.
- Want both? Use both!
- Want something else? There's a rational story there, consult your
language manual for the details.
This is 95% of what users need to know. The rest, they'll be in a
better position to absorb when they've gotten a little more experience,
and started to think through the corner cases themselves. The 2x2 grid
may be the right perspective when explaining the language feature _in
the context of a language design discussion_, but I don't think its
necessarily the right pedagogical technique for a "what's coming" talk.
FWIW.
> Pattern matching
> -----------------------
> Questions after indicated that while the goal is understood, there was
> doubt as to whether it should be the key thing being worked towards.
Yeah, I don't find this too surprising; Java developers are unfamiliar
with pattern matching, so its obviously not something they perceive a
burning need for, hence the "product manager" reaction ("Is this the
most important thing we could be working on? Couldn't you be doing
properties instead?") But, remember that many people said the _exact
same thing_ about lambdas -- "is adding some alpha-geek functional
programming thingie really such a great idea / the most important thing
we could be doing?" But no one says that now.
More information about the amber-dev
mailing list