~/talk

Why we can't have nice things: Generic methods

links:none on file
slides:none on file

Explains why Go refuses generic methods despite clear benefits: examples include rand.N example (nice call chaining versus converting time.Duration to int) and iterator chaining and a caching API. The core claim is implementation limits: compile‑time expansion or runtime boxing are the only viable strategies, but first‑class generic functions, channels of generic functions and interface type assertions break package‑isolated compilation. Allowing generic methods would force either runtime boxing or exclude interfaces, so the feature is omitted to preserve build isolation and performance.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07Use cases for generics
  3. 6:55The proposal
  4. 7:37The generic dilemma
  5. 12:14First class generic functions
  6. 19:38Generic methods limitations
  7. 23:29Evaluation of benefits
  8. 25:15Conclusion and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.