~/talk

A few tips on modelling things in Scala

Talkat Scala Love in the City 2021 · on Saturday, 2021-02-13· [scala, developer-experience]
slides:none on file

Shows concrete rules: use sealed traits for ADTs and smart constructors for invalid combinations; avoid putting mutable state or side‑effecting resources inside case classes (example: counters disappearing from HashSet; arrays-as-keys bug), wrap raw types to get value semantics; split domain models from DB/JSON DTOs and map at boundaries; use Quicklens or optics macros to update deep immutable fields without verbose copies; consolidate repetitive imports and group implicits so newtype + Refined use stays ergonomic across files.

AI-written summary · about

  1. 0:00Introduction
  2. 1:09Case classes in Scala
  3. 10:54Mutability in case classes
  4. 15:53Using toString and show
  5. 16:14Flat vs nested case classes
  6. 21:05Sealed traits for domain modeling
  7. 27:06Avoiding uniform modeling
  8. 37:18Summary and Q&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.