~/talk

Scala best practices I wish someone'd told me about

Talkat Scala Days Lausanne 2019 · 2019-06-11..06-13· [scala, developer-experience]
slides:none on file

Arrays compare by reference so use sameElements not equals; always annotate public return types to avoid ABI breaks; avoid Enumeration — use sealed trait ADTs with final case classes; custom extractors and structural types cause unsafe pattern-match and runtime reflection, prefer type classes; encode errors with Option/Either/Try (or make error types extend Exception for Java interop); don't use non-local return or implicit conversions; run scalafix/scapegoat/wartremover and upgrade to Scala 3 where many issues are fixed.

AI-written summary · about

  1. 0:00Intro
  2. 1:39Array comparison
  3. 3:44Type annotation
  4. 5:30Unicode operators
  5. 7:19Enumerations
  6. 10:22Sealed traits
  7. 12:19Algebraic Data Types
  8. 15:45Case classes
  9. 18:40Custom extractors
  10. 20:55Structural types
  11. 24:04Exceptions
  12. 31:38The return keyword
  13. 33:57Implicit conversions
  14. 36:31Implicit resolution
  15. 39:47String concatenation
  16. 42:04Enforcing best practices
  17. 43:26More good and bad practices
~/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.