~/talk

How to Write Bad Java Code

Talkat Jfokus 2026 · 2026-02-02..02-04· [java]
slides:none on file

Shows concrete fixes: replace repeated string concatenation that creates ~7 temporaries and O(n^2) behavior with a string builder, prefer Optional.ofNullable(...) and maps over nested null checks for safe city lookup, avoid repeated boxing/unboxing in hot loops or use int-streams, compile regex once outside loops instead of recompiling each iteration, let the JVM JIT handle method inlining when possible, and use AtomicInteger or finer-grained locking instead of synchronizing whole methods; mentions Azul VMs and the tool code inventory.

AI-written summary · about

  1. 0:00Introduction
  2. 1:56AI bad code risks
  3. 2:37String concatenation pitfalls
  4. 4:20String vs StringBuilder
  5. 5:43Production testing tools
  6. 6:23Pyramid of doom with Optional
  7. 7:48Boxing overhead in loops
  8. 9:13Regex compilation in loops
  9. 10:57Method calls in loops
  10. 13:25Invariant code outside loops
  11. 14:06Unnecessary synchronization
  12. 14:48Q&A
~/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.