~/talk

String Templates - Syntactic sugar or useful improvement?

Talkat Devoxx France 2024 · 2024-04-17..04-19· [java, compilers-and-language-design]
links:none on file
slides:none on file

Java 21 adds string templates as a preview feature with an explicit SDR processor that calls toString and a built‑in fmt processor that uses printf-style formats; IntelliJ shows migration hints. Custom processors are possible — demos extract Optional values and one processor returns a List instead of a String. The presenter shows a working live-coding demo and a clear anti-pattern where a processor mutates and clears a passed List, proving processors can do harmful side effects.

AI-written summary · about

  1. 0:00Introduction to Java strings
  2. 2:16Legacy string concatenation
  3. 4:35String templates overview
  4. 6:00Working with template syntax
  5. 9:20IDE integration and hints
  6. 10:52Standard template processors
  7. 12:17Custom processors and patterns
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.