ClausPolanka / gilded-rose-kotlin

This is the source code and slides for the Gilded Rose Refactoring Kata talk at KotlinConf 2023

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is the source code and slides for the Gilded Rose Refactoring Kata talk.

Links

IDE refactorings used in the talk

  • Replace 'until' with '..' operator
  • Put parameters on one/separate lines
  • Convert 'String' concatenation to template
  • Convert to expression body
  • Extract function
  • Introduce parameter
  • Convert parameter to receiver
  • Replace 'for' with a 'forEach' function call
  • Convert lambda to reference
  • Replace with '+='
  • Remove braces from 'if' statement
  • Merge 'if's
  • Invert 'if' condition
  • Remove braces from 'else' statement
  • Flip '&&'
  • Split 'if' into two
  • Replace 'if' with 'when'
  • Remove braces from all 'when' entries
  • Lift assignment out of 'if'
  • Split 'if' into two
  • Simplify/delete expression
  • Replace '+=' with ordinary assignment
  • Replace 'when' with 'if'
  • Lift function call out of 'if'
  • Convert function to property
  • Inline function
  • Lift return out of 'if'

Shortcuts used in the talk

Recorded using Activity Tracker plugin.

  • Alt I – Up
  • Alt J – Previous word
  • Alt K – Down
  • Alt L – Next word
  • Alt U – Line start
  • Alt O – Line end
  • Alt N – Left
  • Alt M – Right

  • Alt Shift I – Up with selection
  • Alt Shift J – Previous word with selection
  • Alt Shift K – Down with selection
  • Alt Shift L – Next word with selection
  • Alt Shift U – Line start with selection
  • Alt Shift O – Line end with selection
  • Alt Shift N – Left with selection
  • Alt Shift M – Right with selection

  • Alt , – Previous method
  • Alt . – Next method
  • Alt F – Page down
  • Alt W – Page up
  • Alt B – Back
  • Alt Shift B – Forward
  • Alt H – Jump to source

  • Alt A – Highlight usages in file
  • Alt S – Show usages
  • Alt E – Expand selection
  • Alt / – Cycle expand word
  • Alt ; – Delete
  • Alt R – Rename
  • Alt Shift 8 – Put parameters on one line
  • Alt Shift 9 – Put parameters on separate lines

  • Cmd - – Collapse
  • Cmd = – Expand
  • Cmd Alt - – Collapse recursively
  • Cmd Alt = – Expand recursively
  • Cmd Shift - – Collapse all
  • Cmd Shift = – Expand all

  • Cmd Alt V – Introduce variable
  • Cmd Alt P – Introduce parameter
  • Cmd Alt M – Extract method
  • Cmd Alt N – Inline
  • Cmd Alt L – Reformat code
  • Ctrl Shift J – Join lines

  • Cmd M – Scroll to center
  • Cmd Alt Shift I – Move statement up
  • Cmd Alt Shift K – Move statement down
  • Cmd Shift 8 – Column selection mode
  • Cmd Shift A – Find action
  • Cmd K – Commit
  • Cmd SLimited WIP | Commit without dialog

  • Ctrl Tab – Switcher
  • Ctrl G – Add selection for next occurrence
  • Ctrl B – Git | Branches
  • Ctrl Cmd H – Notifications | Close first
  • Ctrl V – VCS operations popup
  • Ctrl Shift P – Show type info
  • Shift Enter – Start new line
  • Shift Escape – Hide active tool window

  • Shift F10 – Run
  • Alt Shift F10 – Run... (popup)

About

This is the source code and slides for the Gilded Rose Refactoring Kata talk at KotlinConf 2023


Languages

Language:Kotlin 100.0%