~/talk

Refactoring a 1000-Line Method into Clean(er) Code

Talkat JetBrains .NET Day Online 2019 · on Thursday, 2019-05-16· [software-architecture]
slides:none on file

A single ~1,000-line function is dissected and reduced by extracting a depth‑first generator, printing helpers, and rule objects, using ReSharper to guide but intentionally breaking the build to force safe redesign. Roughly a hundred‑plus lines are cut out per refactor, presentation logic is separated from integer state, rule classes replace nested loops, behavior stays equivalent though randomness and unique‑solution guarantees remain open issues, and no comprehensive tests are added before the refactor.

AI-written summary · about

  1. 0:00Start
  2. 0:06The 1000 line function
  3. 9:22Breaking regions into separate functions
  4. 17:20Using compile errors to cut code loose
  5. 25:15Extracting repeat code into separate functions
  6. 32:38Simplifying types and extracting utilities
  7. 38:48Understanding code and redesigning state
  8. 50:50Deeper object structures
~/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.