Slide 1

Slide 1 text

The art of deleting code

Slide 2

Slide 2 text

The art of code 🧘

Slide 3

Slide 3 text

The art of code βœ‚

Slide 4

Slide 4 text

1. Recognize 2. Confirm 3. Share πŸŽ¨βœ‚πŸ‘©πŸ’» 1 of 16 The art of deleting code

Slide 5

Slide 5 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 2 of 16 Recognize code that can be deleted def modal(options = {}) options[:button_style] ||= 'primary' if options[:header_icon] options[:icon] = icon options[:header_icon] end render 'util/modal', options: options end A simple snippet of Ruby code

Slide 6

Slide 6 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 3 of 16 Recognize code that can be deleted def modal(options = {}) options[:button_style] ||= 'primary' if options[:header_icon] options[:icon] = icon options[:header_icon] end render 'util/modal', options: options end A sense of curiosity and wonder πŸ€”

Slide 7

Slide 7 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 4 of 16 Recognize code that can be deleted Find in Project / awk / grep

Slide 8

Slide 8 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 5 of 16 Confirm the code can be deleted def modal(options = {}) options[:button_style] ||= 'primary' if options[:header_icon] options[:icon] = icon options[:header_icon] end render 'util/modal', options: options end 80b1045 Jim S. 2016-12-13 1) 3348fb2 Amy G. 2019-02-09 2) 3348fb2 Amy G. 2019-02-09 3) 27bedae Liza Q. 2018-03-21 4) 3348fb2 Amy G. 2019-02-09 5) 27bedae Liza Q. 2018-03-21 6) 27bedae Liza Q. 2018-03-21 7) 3348fb2 Amy G. 2019-02-09 8) 80b1045 Jim S. 2016-12-13 9) git blame file

Slide 9

Slide 9 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 5 of 16 Confirm the code can be deleted def modal(options = {}) options[:button_style] ||= 'primary' if options[:header_icon] options[:icon] = icon options[:header_icon] end render 'util/modal', options: options end 80b1045 Jim S. 2016-12-13 1) 3348fb2 Amy G. 2019-02-09 2) 3348fb2 Amy G. 2019-02-09 3) 27bedae Liza Q. 2018-03-21 4) 3348fb2 Amy G. 2019-02-09 5) 27bedae Liza Q. 2018-03-21 6) 27bedae Liza Q. 2018-03-21 7) 3348fb2 Amy G. 2019-02-09 8) 80b1045 Jim S. 2016-12-13 9) git blame file

Slide 10

Slide 10 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 6 of 16 Confirm the code can be deleted 27beda180 create an icon helper (3 years, 6 months ago, Liza Q.) diff --git app/helpers/util_helper.rb options[:confirm_button_style] ||= 'primary' + if options[:header_icon] + options[:header_icon] = icon(options[:header_icon], class: 'margin-r-1-2') + end + render 'util/modal', options: options diff --git app/views/delete_app.html.erb - <%= modal(confirm_button_style: 'warning') do %> + <%= modal(confirm_button_style: 'warning', header_icon: 'warning') do %> Delete this app git show SHA

Slide 11

Slide 11 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 7 of 16 Confirm the code can be deleted git log file git log app/views/delete_app.html.erb fatal: ambiguous argument 'app/views/delete_app.html.erb': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'

Slide 12

Slide 12 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 7 of 16 Confirm the code can be deleted git log file git log app/views/delete_app.html.erb fatal: ambiguous argument 'app/views/delete_app.html.erb': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' git log --follow -- app/views/delete_app.html.erb 86eba3127 Remove the delete app card and modal (2 years, 6 months ago, Mike C.) 650365ba2 Alphabetize the args (3 years, 5 months ago, Joan A.) ……… 27beda180 create an icon helper (3 years, 6 months ago, Liza Q.)

Slide 13

Slide 13 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 8 of 16 Share knowledge about the deletion git commit commit a37b6725 Date: Wed Jan 13 10:24:39 2021 -0800 βœ‚ Remove unused option header_icon It was introduced in 27beda180 but its last invocation was removed in 86eba3127. diff --git app/helpers/util_helper.rb options[:confirm_button_style] ||= 'primary' - if options[:header_icon] - options[:header_icon] = icon(options[:header_icon], class: 'margin-r-1-2') - end - render 'util/modal', options: options

Slide 14

Slide 14 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 9 of 16 Share knowledge about the deletion git stash git status Changes not staged for commit: modified: app/helpers/util_helper.rb Untracked files: app/views/add_app.html.erb

Slide 15

Slide 15 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 9 of 16 Share knowledge about the deletion git stash git status Changes not staged for commit: modified: app/helpers/util_helper.rb Untracked files: app/views/add_app.html.erb git stash --include-untracked Saved working directory and index state WIP on feature_branch: 073a5e03f

Slide 16

Slide 16 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 9 of 16 Share knowledge about the deletion git stash git status Changes not staged for commit: modified: app/helpers/util_helper.rb Untracked files: app/views/add_app.html.erb git stash --include-untracked Saved working directory and index state WIP on feature_branch: 073a5e03f git stash apply

Slide 17

Slide 17 text

1. Recognize 2. Confirm 3. Share πŸŽ¨βœ‚πŸ‘©πŸ’» 10 of 16 The art of deleting code

Slide 18

Slide 18 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 11 of 16 Recognize code that can be deleted Code coverage beyond testing

Slide 19

Slide 19 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 12 of 16 Confirm the code can be deleted git log file πŸ€” git log app/views/delete_app.html.erb fatal: ambiguous argument 'app/views/delete_app.html.erb': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' git log --follow -- app/views/delete_app.html.erb 86eba3127 Remove the delete app card and modal (2 years, 6 months ago, Mike C.) ……… 650365ba2 Alphabetize the args (3 years, 5 months ago, Joan A.) 27beda180 create an icon helper (3 years, 6 months ago, Liza Q.)

Slide 20

Slide 20 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 13 of 16 Confirm the code can be deleted git log file git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments (3 days ago, Joan A.) 0f14cf51e HTML cleanup (4 months ago, Joan A.) a3c92896c Fix the link to embedded apps(6 months ago, Mike C.) 81634ab2a Remove app feature flag (7 months ago, Sarah K.) 1054bcb23 add a dedicated component (8 months ago, Sarah K.) (dozens of other commits) b921b4e05 Add metrics show page (2 years, 9 months ago, Sam P.) 5c177ca9c Move endpoint under app (3 years, 1 month ago, Joan A.) 650365ba2 Alphabetize the args (3 years, 5 months ago, Joan A.) 27beda180 create an icon helper (3 years, 6 months ago, Liza Q.)

Slide 21

Slide 21 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 13 of 16 Confirm the code can be deleted git log file git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments (3 days ago, Joan A.) 0f14cf51e HTML cleanup (4 months ago, Joan A.) a3c92896c Fix the link to embedded apps(6 months ago, Mike C.) 81634ab2a Remove app feature flag (7 months ago, Sarah K.) 1054bcb23 add a dedicated component (8 months ago, Sarah K.) (dozens of other commits) b921b4e05 Add metrics show page (2 years, 9 months ago, Sam P.) 5c177ca9c Move endpoint under app (3 years, 1 month ago, Joan A.) 650365ba2 Alphabetize the args (3 years, 5 months ago, Joan A.) 27beda180 create an icon helper (3 years, 6 months ago, Liza Q.) The code was added here

Slide 22

Slide 22 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 13 of 16 Confirm the code can be deleted git log file git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments (3 days ago, Joan A.) 0f14cf51e HTML cleanup (4 months ago, Joan A.) a3c92896c Fix the link to embedded apps(6 months ago, Mike C.) 81634ab2a Remove app feature flag (7 months ago, Sarah K.) 1054bcb23 add a dedicated component (8 months ago, Sarah K.) (dozens of other commits) b921b4e05 Add metrics show page (2 years, 9 months ago, Sam P.) 5c177ca9c Move endpoint under app (3 years, 1 month ago, Joan A.) 650365ba2 Alphabetize the args (3 years, 5 months ago, Joan A.) 27beda180 create an icon helper (3 years, 6 months ago, Liza Q.) The code is not there anymore The code was added here

Slide 23

Slide 23 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 13 of 16 Confirm the code can be deleted git log file git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments (3 days ago, Joan A.) 0f14cf51e HTML cleanup (4 months ago, Joan A.) a3c92896c Fix the link to embedded apps(6 months ago, Mike C.) 81634ab2a Remove app feature flag (7 months ago, Sarah K.) 1054bcb23 add a dedicated component (8 months ago, Sarah K.) (dozens of other commits) b921b4e05 Add metrics show page (2 years, 9 months ago, Sam P.) 5c177ca9c Move endpoint under app (3 years, 1 month ago, Joan A.) 650365ba2 Alphabetize the args (3 years, 5 months ago, Joan A.) 27beda180 create an icon helper (3 years, 6 months ago, Liza Q.) The code is not there anymore The code was added here Which commit removed it?

Slide 24

Slide 24 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 25

Slide 25 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 27beda180 git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 26

Slide 26 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 27beda180 git bisect bad 957e23451 git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 27

Slide 27 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 27beda180 git bisect bad 957e23451 Bisecting: 21 revisions left to test (roughly 5 steps) [09087ede5] Remove URL field git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 28

Slide 28 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 27beda180 git bisect bad 957e23451 Bisecting: 21 revisions left to test (roughly 5 steps) [09087ede5] Remove URL field grep -c header_icon app/views/delete_app.html.erb 0 git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 29

Slide 29 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 27beda180 git bisect bad 957e23451 Bisecting: 21 revisions left to test (roughly 5 steps) [09087ede5] Remove URL field grep -c header_icon app/views/delete_app.html.erb 0 git bisect bad Bisecting: 11 revisions left to test (roughly 4 steps) [81002123a] Enhance styling of views git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 30

Slide 30 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 27beda180 git bisect bad 09087ede5 Bisecting: 11 revisions left to test (roughly 4 steps) [81002123a] Enhance styling of views grep -c header_icon app/views/delete_app.html.erb 1 git bisect good Bisecting: 5 revisions left to test (roughly 3 steps) [192734cdc] Refactor form git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 31

Slide 31 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 81002123a git bisect bad 09087ede5 Bisecting: 5 revisions left to test (roughly 3 steps) [192734cdc] Refactor form grep -c header_icon app/views/delete_app.html.erb 0 git bisect bad Bisecting: 2 revisions left to test (roughly 2 steps) [93435aa23] Add internationalization to views git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 32

Slide 32 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 81002123a git bisect bad 192734cdc Bisecting: 2 revisions left to test (roughly 2 steps) [93435aa23] Add internationalization to views grep -c header_icon app/views/delete_app.html.erb 1 git bisect good Bisecting: 1 revisions left to test (roughly 1 step) [812673dc8] Remove UID component git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 33

Slide 33 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 14 of 16 Confirm the code can be deleted git bisect git bisect start git bisect good 81002123a git bisect bad 192734cdc Bisecting: 1 revisions left to test (roughly 1 step) [812673dc8] Remove UID component grep -c header_icon app/views/delete_app.html.erb 1 git bisect good 192734cdc is the first bad commit git bisect reset git log app/views/delete_app.html.erb 957e23451 Alphabetize the method arguments 0f14cf51e HTML cleanup a3c92896c Fix the link to embedded apps 81634ab2a Remove app feature flag 1054bcb23 Fix typo 1054bcb23 Remove alternate versionable flow 5c177ca9c Move endpoint under app 9203e6345 Remove i18n strings 45629435c Make Rubocop happy 909345aac Fix validation name 77346234b Merge pull request #1296 192837492 Added new section for resource 772934ded Add better validation message dad734de3 Cleanup comments 98934dcdd Validate schema 012934dcd Inject UID component bbe364bbd Correct typo in app scope b763748bd Add indices and sorting 8dcd51283 Merge pull request #1212 9093461ca Change reference to app 883945671 Hound happiness 09087ede5 Remove URL field 7722ded56 More testing 888ddaa12 Make Hound happy 93467cd3d Add info to metadata 912734823 Remove website field 192734cdc Refactor form 812673dc8 Remove UID component 93435aa23 Add internationalization to views 734563cdc Refactor 99d6253dd Apply CSS framework changes 9aaab4344 Fix notification 81002123a Enhance styling of views acd41623d WIP 28495cdc1 Merge pull request #1001 28945c1ca Remove single quotes 94578694a Initial tweaks for update 1276384cd Add help text 3657831ac Merge pull request #912 447651234 Add frozen string comment 4890dedac Add feature flag 650365ba2 Alphabetize the args 27beda180 create an icon helper

Slide 34

Slide 34 text

πŸŽ¨βœ‚πŸ‘©πŸ’» 15 of 16 Share knowledge about the deletion git commit commit a37b6725 Date: Wed Jan 13 10:24:39 2021 -0800 βœ‚ Remove unused option header_icon It was introduced in 27beda180 but its last invocation was removed in 192734cdc. diff --git app/helpers/util_helper.rb options[:confirm_button_style] ||= 'primary' - if options[:header_icon] - options[:header_icon] = icon(options[:header_icon], class: 'margin-r-1-2') - end - render 'util/modal', options: options

Slide 35

Slide 35 text

git blame [file] When and why was this code added? git show [commit SHA] What other code was added at the same time? git log --follow -- [file] How was the other code changed over time? git bisect start/good/bad/reset What is the relevant change that justifies the deletion? πŸŽ¨βœ‚πŸ‘©πŸ’» 16 of 16 The art of deleting code A list of helpful git commands git stash --include-untracked Pause your current feature work git commit Write a meaningful message that includes all the relevant SHA to help the reviewers git stash apply Resume your current feature work

Slide 36

Slide 36 text

The art of code ❀

Slide 37

Slide 37 text

The art of deleting code