~/talk

Clean Code Refactoring

Talkat SunshinePHP 2014 · 2014-02-06..02-08· [developer-experience]
speakerdeck:jcarouth
slides:none on file

Claims two concrete rules: write dirty code first then clean it and leave the code cleaner than you found it. Shows refactor steps on real PHP code: guard clauses, extract method, null object pattern, move DB access into an account data provider using PDO, validate UUIDs as 36‑char strings. Demonstrates three possible returns (exception null account) and runs tests between steps so each refactor keeps behavior intact — tests pass after each change.

AI-written summary · about

  1. 0:00Start
  2. 2:51THE TWO RULES OF CLEAN CODE
  3. 3:02RULE #1 Write dirty code, then clean it.
  4. 5:51RULE #2
  5. 7:43AN EXAMPLE
  6. 14:38REFACTORING
  7. 38:07RECAP
~/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.