WEBVTT

1
00:00:01.680 --> 00:00:05.220
<00:00:01.680>Hi <00:00:01.807>everyone. <00:00:01.934>So <00:00:02.061>I'm <00:00:02.189>Ana, <00:00:02.316>I'm <00:00:02.443>a <00:00:02.570>group <00:00:02.698>product <00:00:02.825>manager <00:00:02.952>at <00:00:03.080>Depot.

2
00:00:05.640 --> 00:00:08.220
<00:00:05.640>You <00:00:05.756>may <00:00:05.873>know <00:00:05.989>by <00:00:06.106>now <00:00:06.223>that <00:00:06.340>Depot <00:00:06.456>is <00:00:06.573>a <00:00:06.689>partner <00:00:06.806>at <00:00:06.923>this <00:00:07.039>event.

3
00:00:08.220 --> 00:00:11.500
<00:00:08.220>We <00:00:08.313>have <00:00:08.406>a <00:00:08.500>booth <00:00:08.593>just <00:00:08.686>around <00:00:08.780>the <00:00:08.873>corner, <00:00:08.966>so <00:00:09.060>if <00:00:09.153>you <00:00:09.246>haven't <00:00:09.340>yet, <00:00:09.433>please <00:00:09.526>come <00:00:09.620>by.

4
00:00:12.160 --> 00:00:12.880
Um,

5
00:00:12.880 --> 00:00:17.200
<00:00:12.880>the <00:00:12.980>subject <00:00:13.080>I <00:00:13.180>want <00:00:13.280>to <00:00:13.380>talk <00:00:13.480>to <00:00:13.580>you <00:00:13.680>about <00:00:13.780>is <00:00:13.880>something <00:00:13.980>that <00:00:14.080>can <00:00:14.180>be <00:00:14.280>controversial

6
00:00:17.420 --> 00:00:21.120
<00:00:17.420>and <00:00:17.547>can <00:00:17.674>be <00:00:17.801>a <00:00:17.929>point <00:00:18.056>of <00:00:18.183>contention <00:00:18.310>between <00:00:18.438>product <00:00:18.565>managers <00:00:18.692>and <00:00:18.820>developers.

7
00:00:21.380 --> 00:00:26.320
<00:00:21.380>And <00:00:21.507>that's <00:00:21.634>refactoring <00:00:21.761>the <00:00:21.889>main <00:00:22.016>point <00:00:22.143>I <00:00:22.270>will <00:00:22.398>try <00:00:22.525>to <00:00:22.652>make <00:00:22.779>is

8
00:00:26.320 --> 00:00:29.480
<00:00:26.320>that <00:00:26.495>contrary <00:00:26.670>to <00:00:26.845>what <00:00:27.020>many <00:00:27.195>people <00:00:27.370>seem <00:00:27.545>to <00:00:27.720>believe,

9
00:00:29.830 --> 00:00:31.440
<00:00:29.830>refactoring <00:00:30.296>is <00:00:30.763>something <00:00:31.229>that,

10
00:00:31.700 --> 00:00:36.080
<00:00:31.700>or <00:00:31.807>the <00:00:31.915>value <00:00:32.023>of <00:00:32.130>refactoring <00:00:32.238>is <00:00:32.346>something <00:00:32.453>that <00:00:32.561>can <00:00:32.669>be <00:00:32.776>both <00:00:32.884>measured <00:00:32.992>and <00:00:33.100>managed.

11
00:00:36.500 --> 00:00:40.540
<00:00:36.500>So, <00:00:36.700>uh, <00:00:36.900>let's <00:00:37.100>try. <00:00:37.300>Um, <00:00:37.500>so, <00:00:37.700>you <00:00:37.900>know,

12
00:00:40.640 --> 00:00:43.380
<00:00:40.640>in <00:00:40.780>many <00:00:40.920>American <00:00:41.060>movies <00:00:41.200>when <00:00:41.340>they <00:00:41.480>want <00:00:41.620>to <00:00:41.760>mock <00:00:41.900>a <00:00:42.040>wedding,

13
00:00:43.410 --> 00:00:46.580
<00:00:43.410>there's <00:00:43.537>a <00:00:43.664>really <00:00:43.791>bad <00:00:43.919>speech <00:00:44.046>at <00:00:44.173>the <00:00:44.300>wedding <00:00:44.428>that <00:00:44.555>starts <00:00:44.682>with <00:00:44.809>web,

14
00:00:46.580 --> 00:00:49.260
<00:00:46.580>website <00:00:46.860>dictionary <00:00:47.140>defines <00:00:47.420>love <00:00:47.699>as <00:00:47.980>something.

15
00:00:49.880 --> 00:00:54.220
<00:00:49.880>And <00:00:49.973>unfortunately <00:00:50.066>I <00:00:50.160>need <00:00:50.253>to <00:00:50.346>do <00:00:50.440>this <00:00:50.533>to <00:00:50.626>you <00:00:50.720>because <00:00:50.813>I <00:00:50.906>need <00:00:51.000>to <00:00:51.093>start <00:00:51.186>with <00:00:51.280>the

16
00:00:54.220 --> 00:00:55.300
<00:00:54.220>definition <00:00:54.705>of <00:00:55.192>refactory.

17
00:00:55.980 --> 00:00:59.620
<00:00:55.980>I <00:00:56.107>need <00:00:56.234>to <00:00:56.361>at <00:00:56.489>least <00:00:56.616>touch <00:00:56.743>upon <00:00:56.870>this <00:00:56.998>definition <00:00:57.125>to <00:00:57.252>acknowledge <00:00:57.379>something.

18
00:01:00.440 --> 00:01:02.380
<00:01:00.440>So <00:01:00.790>many, <00:01:01.140>many <00:01:01.489>years <00:01:01.839>ago,

19
00:01:02.900 --> 00:01:05.460
<00:01:02.900>I <00:01:03.055>had <00:01:03.211>the <00:01:03.366>pleasure <00:01:03.522>of <00:01:03.677>translating <00:01:03.833>this <00:01:03.988>book <00:01:04.144>into <00:01:04.300>Polish.

20
00:01:06.080 --> 00:01:09.220
<00:01:06.080>And <00:01:06.196>the <00:01:06.313>definition <00:01:06.429>that <00:01:06.546>you <00:01:06.663>see <00:01:06.780>actually <00:01:06.896>comes <00:01:07.013>from <00:01:07.130>this <00:01:07.246>book <00:01:07.363>by, <00:01:07.480>uh,

21
00:01:09.220 --> 00:01:10.500
<00:01:09.220>Martin <00:01:09.604>Fowler <00:01:09.988>and <00:01:10.372>Quebec.

22
00:01:10.920 --> 00:01:15.740
<00:01:10.920>So <00:01:11.020>refactoring <00:01:11.120>as <00:01:11.220>a <00:01:11.320>noun <00:01:11.420>is <00:01:11.520>a <00:01:11.620>change <00:01:11.720>made <00:01:11.820>to <00:01:11.920>the <00:01:12.020>internal <00:01:12.120>structure <00:01:12.220>of <00:01:12.320>software

23
00:01:15.760 --> 00:01:20.580
<00:01:15.760>to <00:01:15.876>make <00:01:15.993>it <00:01:16.110>easier <00:01:16.226>to <00:01:16.343>understand <00:01:16.460>and <00:01:16.576>cheaper <00:01:16.693>to <00:01:16.810>modify <00:01:16.926>without <00:01:17.043>changing <00:01:17.160>its

24
00:01:20.580 --> 00:01:23.940
<00:01:20.580>observable <00:01:20.780>behavior. <00:01:20.980>And <00:01:21.179>then <00:01:21.380>refactoring <00:01:21.580>as <00:01:21.780>a <00:01:21.980>verb.

25
00:01:23.960 --> 00:01:28.420
<00:01:23.960>So <00:01:24.087>two <00:01:24.214>refactor <00:01:24.341>means <00:01:24.469>to <00:01:24.596>restructure <00:01:24.723>software <00:01:24.850>by <00:01:24.978>applying <00:01:25.105>a <00:01:25.232>series <00:01:25.360>of

26
00:01:28.420 --> 00:01:33.260
<00:01:28.420>refactorings <00:01:28.560>without <00:01:28.700>changing <00:01:28.840>its <00:01:28.980>observable <00:01:29.120>behavior. <00:01:29.260>And <00:01:29.400>now <00:01:29.540>over <00:01:29.680>the <00:01:29.820>years,

27
00:01:33.760 --> 00:01:38.420
<00:01:33.759>uh, <00:01:33.876>Martin <00:01:33.993>Fowler <00:01:34.109>got <00:01:34.226>frustrated <00:01:34.343>with <00:01:34.460>sort <00:01:34.576>of <00:01:34.693>a <00:01:34.809>life <00:01:34.926>of <00:01:35.043>its <00:01:35.160>own

28
00:01:38.770 --> 00:01:42.540
<00:01:38.770>that <00:01:39.003>this, <00:01:39.236>uh, <00:01:39.470>term <00:01:39.703>has <00:01:39.936>gained. <00:01:40.170>Um,

29
00:01:42.960 --> 00:01:45.500
<00:01:42.960>so <00:01:43.087>this <00:01:43.214>is <00:01:43.341>a <00:01:43.469>quote <00:01:43.596>from <00:01:43.723>a <00:01:43.850>newer <00:01:43.978>blog <00:01:44.105>post <00:01:44.232>by <00:01:44.360>him.

30
00:01:46.240 --> 00:01:50.860
<00:01:46.240>If <00:01:46.340>somebody <00:01:46.440>talks <00:01:46.540>about <00:01:46.640>a <00:01:46.740>system <00:01:46.840>being <00:01:46.940>broken <00:01:47.040>for <00:01:47.140>a <00:01:47.240>couple <00:01:47.340>of <00:01:47.440>days <00:01:47.540>while <00:01:47.640>they

31
00:01:50.860 --> 00:01:55.540
<00:01:50.860>are <00:01:50.976>refactoring, <00:01:51.093>you <00:01:51.210>can <00:01:51.326>be <00:01:51.443>pretty <00:01:51.560>sure <00:01:51.676>they <00:01:51.793>are <00:01:51.910>not <00:01:52.026>in <00:01:52.143>fact <00:01:52.260>refactoring.

32
00:01:56.040 --> 00:02:01.020
<00:01:56.039>So <00:01:56.139>what <00:01:56.240>he <00:01:56.339>is <00:01:56.440>trying <00:01:56.539>to <00:01:56.639>say <00:01:56.740>here <00:01:56.839>is <00:01:56.940>that <00:01:57.039>refactoring <00:01:57.139>is <00:01:57.240>not <00:01:57.339>just <00:01:57.440>any

33
00:02:01.580 --> 00:02:03.860
<00:02:01.580>restructuring <00:02:01.755>you <00:02:01.929>can <00:02:02.105>apply <00:02:02.280>to <00:02:02.455>clean <00:02:02.630>up <00:02:02.804>your <00:02:02.980>code.

34
00:02:04.250 --> 00:02:08.420
<00:02:04.250>This <00:02:04.377>is <00:02:04.504>a <00:02:04.631>particular <00:02:04.759>technique, <00:02:04.886>technique <00:02:05.013>of <00:02:05.140>very <00:02:05.268>small <00:02:05.395>increments <00:02:05.522>you <00:02:05.650>do,

35
00:02:08.420 --> 00:02:13.380
<00:02:08.419>which <00:02:08.575>is <00:02:08.731>very <00:02:08.886>safe. <00:02:09.042>Um, <00:02:09.197>but <00:02:09.353>in <00:02:09.508>my <00:02:09.664>talk <00:02:09.820>actually,

36
00:02:13.410 --> 00:02:17.060
<00:02:13.410>when <00:02:13.549>I <00:02:13.690>say <00:02:13.829>refactoring, <00:02:13.970>I <00:02:14.109>don't <00:02:14.250>necessarily <00:02:14.390>mean <00:02:14.530>this <00:02:14.670>narrow <00:02:14.810>definition.

37
00:02:17.740 --> 00:02:21.860
<00:02:17.740>I <00:02:17.847>mean <00:02:17.955>refactoring <00:02:18.063>as <00:02:18.170>we, <00:02:18.278>most <00:02:18.386>of <00:02:18.493>us <00:02:18.601>at <00:02:18.709>least <00:02:18.816>learn <00:02:18.924>to <00:02:19.032>understand <00:02:19.140>it,

38
00:02:22.410 --> 00:02:26.540
<00:02:22.410>just <00:02:22.585>restructuring <00:02:22.760>the <00:02:22.935>code <00:02:23.109>to <00:02:23.285>make <00:02:23.460>it <00:02:23.635>cleaner. <00:02:23.810>Uh,

39
00:02:26.600 --> 00:02:27.860
<00:02:26.600>so <00:02:26.978>as <00:02:27.356>I <00:02:27.734>said,

40
00:02:28.450 --> 00:02:32.700
<00:02:28.450>this <00:02:28.549>can <00:02:28.649>be <00:02:28.750>a <00:02:28.850>controversial <00:02:28.950>subject <00:02:29.049>and <00:02:29.149>I <00:02:29.250>have <00:02:29.350>seen <00:02:29.450>it <00:02:29.549>trigger <00:02:29.649>the <00:02:29.750>fight <00:02:29.850>or

41
00:02:32.700 --> 00:02:35.500
<00:02:32.700>flight <00:02:32.980>response <00:02:33.260>from <00:02:33.540>product <00:02:33.820>managers, <00:02:34.100>um,

42
00:02:35.670 --> 00:02:39.260
<00:02:35.670>especially <00:02:35.825>product <00:02:35.981>managers <00:02:36.136>who <00:02:36.292>don't <00:02:36.447>have <00:02:36.603>a <00:02:36.758>strong <00:02:36.914>technical <00:02:37.070>background.

43
00:02:39.840 --> 00:02:42.340
<00:02:39.840>And <00:02:40.120>also, <00:02:40.400>um, <00:02:40.680>I <00:02:40.960>have, <00:02:41.240>uh,

44
00:02:42.530 --> 00:02:46.100
<00:02:42.530>been <00:02:42.623>in <00:02:42.716>this <00:02:42.810>situation <00:02:42.903>a <00:02:42.996>couple <00:02:43.090>of <00:02:43.183>times <00:02:43.276>in <00:02:43.370>my <00:02:43.463>life <00:02:43.556>where <00:02:43.650>I <00:02:43.743>was <00:02:43.836>the <00:02:43.930>first

45
00:02:46.100 --> 00:02:48.620
<00:02:46.100>product <00:02:46.333>manager <00:02:46.566>working <00:02:46.799>with <00:02:47.033>a <00:02:47.266>backend <00:02:47.500>team.

46
00:02:49.240 --> 00:02:51.780
<00:02:49.240>So <00:02:49.395>they <00:02:49.551>who <00:02:49.706>are <00:02:49.862>not <00:02:50.017>used <00:02:50.173>to <00:02:50.328>working <00:02:50.484>with <00:02:50.640>product.

47
00:02:52.360 --> 00:02:56.020
<00:02:52.360>And <00:02:52.515>the <00:02:52.671>main <00:02:52.826>fear <00:02:52.982>that <00:02:53.137>those <00:02:53.293>teams <00:02:53.448>expressed <00:02:53.604>was, <00:02:53.760>okay,

48
00:02:56.250 --> 00:02:59.020
<00:02:56.250>working <00:02:56.483>with <00:02:56.716>product <00:02:56.950>means <00:02:57.183>no <00:02:57.416>more <00:02:57.650>refactoring.

49
00:02:59.460 --> 00:03:00.880
<00:02:59.460>So <00:02:59.779>a <00:03:00.099>product <00:03:00.418>manager <00:03:00.738>comes,

50
00:03:01.020 --> 00:03:03.480
<00:03:01.020>we <00:03:01.136>are <00:03:01.253>going <00:03:01.370>to <00:03:01.486>be <00:03:01.603>doing <00:03:01.720>feature <00:03:01.836>of <00:03:01.953>the <00:03:02.070>feature <00:03:02.186>of <00:03:02.303>the <00:03:02.420>feature,

51
00:03:03.940 --> 00:03:08.920
<00:03:03.940>the <00:03:04.027>code <00:03:04.115>quality <00:03:04.202>is <00:03:04.290>going <00:03:04.377>to <00:03:04.465>go <00:03:04.552>to <00:03:04.640>hell. <00:03:04.727>It <00:03:04.815>doesn't <00:03:04.902>have <00:03:04.990>to <00:03:05.077>be <00:03:05.165>like <00:03:05.252>this. <00:03:05.340>Um,

52
00:03:09.160 --> 00:03:13.930
<00:03:09.160>I <00:03:09.276>want <00:03:09.393>to <00:03:09.510>describe <00:03:09.626>five <00:03:09.743>approaches <00:03:09.859>to <00:03:09.976>refactoring <00:03:10.093>that <00:03:10.210>I <00:03:10.326>have <00:03:10.443>seen. <00:03:10.560>Um,

53
00:03:14.060 --> 00:03:15.610
<00:03:14.060>let's <00:03:14.408>see. <00:03:14.757>The <00:03:15.106>first <00:03:15.455>one,

54
00:03:16.120 --> 00:03:20.730
<00:03:16.120>this <00:03:16.260>is <00:03:16.400>the <00:03:16.540>flight <00:03:16.680>response <00:03:16.820>where <00:03:16.960>the <00:03:17.100>product <00:03:17.240>manager <00:03:17.380>says, <00:03:17.520>okay,

55
00:03:20.730 --> 00:03:21.563
<00:03:20.730>it's <00:03:20.979>not <00:03:21.229>my <00:03:21.479>job.

56
00:03:21.890 --> 00:03:25.410
<00:03:21.890>Engineering <00:03:21.997>knows <00:03:22.105>best <00:03:22.213>I'm <00:03:22.320>going <00:03:22.428>to <00:03:22.536>throw <00:03:22.643>this <00:03:22.751>work <00:03:22.859>over <00:03:22.966>the <00:03:23.074>wall <00:03:23.182>to <00:03:23.290>them,

57
00:03:25.950 --> 00:03:30.910
<00:03:25.950>and <00:03:26.043>if <00:03:26.136>they <00:03:26.230>spend <00:03:26.323>half <00:03:26.416>the <00:03:26.510>time <00:03:26.603>refactoring, <00:03:26.696>so <00:03:26.790>be <00:03:26.883>it. <00:03:26.976>So <00:03:27.070>this <00:03:27.163>is <00:03:27.256>one <00:03:27.350>approach.

58
00:03:31.700 --> 00:03:32.830
<00:03:31.700>Then <00:03:32.039>we <00:03:32.378>have, <00:03:32.716>um,

59
00:03:33.670 --> 00:03:37.670
<00:03:33.670>a <00:03:33.845>more <00:03:34.020>more <00:03:34.195>moderate <00:03:34.370>approach <00:03:34.545>where <00:03:34.720>we <00:03:34.895>agree, <00:03:35.070>okay,

60
00:03:38.290 --> 00:03:42.390
<00:03:38.290>so <00:03:38.406>a <00:03:38.523>percentage <00:03:38.640>of <00:03:38.756>time <00:03:38.873>is <00:03:38.989>going <00:03:39.106>to <00:03:39.223>do <00:03:39.340>to <00:03:39.456>refactoring <00:03:39.573>and <00:03:39.690>maintenance.

61
00:03:42.400 --> 00:03:47.230
<00:03:42.400>Maybe <00:03:42.540>this <00:03:42.680>can <00:03:42.820>be <00:03:42.960>one <00:03:43.100>in <00:03:43.240>every <00:03:43.380>five <00:03:43.520>sprints <00:03:43.660>being <00:03:43.800>a

62
00:03:47.230 --> 00:03:48.190
<00:03:47.230>refactoring <00:03:48.094>sprint,

63
00:03:48.530 --> 00:03:51.590
<00:03:48.530>or <00:03:48.646>there's <00:03:48.763>a <00:03:48.880>lane <00:03:48.996>in <00:03:49.113>our <00:03:49.230>Scrabble <00:03:49.346>cardboard <00:03:49.463>board <00:03:49.580>and <00:03:49.696>we <00:03:49.813>say, <00:03:49.930>okay,

64
00:03:51.820 --> 00:03:56.390
<00:03:51.820>refactoring <00:03:51.975>goes <00:03:52.131>into <00:03:52.286>this <00:03:52.442>lane <00:03:52.597>and <00:03:52.753>20% <00:03:52.908>of <00:03:53.064>work, <00:03:53.220>uh,

65
00:03:56.390 --> 00:03:59.350
<00:03:56.390>can <00:03:56.529>be <00:03:56.670>refactoring. <00:03:56.809>So <00:03:56.950>this <00:03:57.089>is <00:03:57.230>an <00:03:57.369>option <00:03:57.510>that <00:03:57.649>you <00:03:57.790>have.

66
00:04:00.260 --> 00:04:03.950
<00:04:00.260>Then <00:04:00.435>we <00:04:00.609>have <00:04:00.785>targeted <00:04:00.959>refactoring <00:04:01.135>where <00:04:01.310>we <00:04:01.484>say, <00:04:01.660>okay,

67
00:04:04.450 --> 00:04:08.030
<00:04:04.450>if <00:04:04.577>you <00:04:04.704>are <00:04:04.831>touching <00:04:04.959>a <00:04:05.086>method, <00:04:05.213>let's <00:04:05.340>say <00:04:05.468>in <00:04:05.595>that <00:04:05.722>code <00:04:05.850>base,

68
00:04:08.370 --> 00:04:11.310
<00:04:08.370>you <00:04:08.525>can <00:04:08.681>or <00:04:08.836>you <00:04:08.992>should <00:04:09.147>refactor <00:04:09.303>it <00:04:09.458>as <00:04:09.614>you <00:04:09.770>go.

69
00:04:12.130 --> 00:04:15.390
<00:04:12.130>One <00:04:12.305>way <00:04:12.480>of <00:04:12.655>ensuring <00:04:12.829>it <00:04:13.005>can <00:04:13.180>be <00:04:13.355>you, <00:04:13.530>um,

70
00:04:15.870 --> 00:04:20.150
<00:04:15.870>describe <00:04:15.963>it <00:04:16.056>in <00:04:16.149>the <00:04:16.243>definition <00:04:16.336>of <00:04:16.430>done <00:04:16.523>that <00:04:16.616>the <00:04:16.709>code <00:04:16.803>that <00:04:16.896>was <00:04:16.990>touched <00:04:17.083>has <00:04:17.176>to <00:04:17.269>meet

71
00:04:20.150 --> 00:04:23.950
<00:04:20.149>certain <00:04:20.325>criteria. <00:04:20.500>And <00:04:20.674>then <00:04:20.849>refactoring <00:04:21.024>happens <00:04:21.200>as <00:04:21.375>we <00:04:21.549>go.

72
00:04:25.690 --> 00:04:30.390
<00:04:25.690>My <00:04:25.817>favorite <00:04:25.944>is <00:04:26.071>refactoring <00:04:26.199>as <00:04:26.326>a <00:04:26.453>roadmap <00:04:26.580>item. <00:04:26.708>So <00:04:26.835>we <00:04:26.962>just, <00:04:27.090>uh,

73
00:04:30.570 --> 00:04:34.350
<00:04:30.570>try <00:04:30.686>to <00:04:30.803>weigh, <00:04:30.920>okay, <00:04:31.036>now <00:04:31.153>we <00:04:31.270>work <00:04:31.386>on <00:04:31.503>this <00:04:31.620>feature, <00:04:31.736>on <00:04:31.853>this <00:04:31.969>project,

74
00:04:34.850 --> 00:04:38.270
<00:04:34.850>and <00:04:35.005>then <00:04:35.161>we <00:04:35.316>focus <00:04:35.472>on <00:04:35.627>refactoring <00:04:35.783>to <00:04:35.938>do <00:04:36.094>it <00:04:36.250>right.

75
00:04:39.400 --> 00:04:42.260
<00:04:39.400>And <00:04:39.750>finally <00:04:40.099>the <00:04:40.450>fight <00:04:40.799>response.

76
00:04:42.360 --> 00:04:46.780
<00:04:42.360>So <00:04:42.500>no <00:04:42.640>refactoring <00:04:42.780>at <00:04:42.920>all <00:04:43.060>is <00:04:43.200>also <00:04:43.340>something <00:04:43.480>that <00:04:43.620>sometimes <00:04:43.760>happens.

77
00:04:47.640 --> 00:04:52.500
<00:04:47.640>So <00:04:47.740>now <00:04:47.840>I'm <00:04:47.940>going <00:04:48.039>to <00:04:48.140>try <00:04:48.240>to <00:04:48.340>show <00:04:48.440>you <00:04:48.539>good <00:04:48.640>and <00:04:48.740>bad <00:04:48.840>reasons <00:04:48.940>to <00:04:49.039>refactor.

78
00:04:52.560 --> 00:04:56.660
<00:04:52.560>So <00:04:52.667>I'm <00:04:52.775>not <00:04:52.883>going <00:04:52.990>to <00:04:53.098>talk <00:04:53.206>about <00:04:53.313>good <00:04:53.421>and <00:04:53.529>bad <00:04:53.636>refactoring. <00:04:53.744>Uh, <00:04:53.852>you <00:04:53.960>know,

79
00:04:56.660 --> 00:05:01.020
<00:04:56.659>that <00:04:56.767>product <00:04:56.875>people <00:04:56.983>are <00:04:57.090>fixated <00:04:57.198>on <00:04:57.306>the <00:04:57.413>why, <00:04:57.521>on <00:04:57.629>the <00:04:57.736>reasons <00:04:57.844>for <00:04:57.952>doing <00:04:58.059>things.

80
00:05:01.480 --> 00:05:03.860
<00:05:01.480>So <00:05:01.655>I'm <00:05:01.830>going <00:05:02.005>to <00:05:02.180>talk <00:05:02.355>about <00:05:02.530>reasons <00:05:02.705>to <00:05:02.880>refactor.

81
00:05:04.360 --> 00:05:09.340
<00:05:04.360>So <00:05:04.453>this <00:05:04.546>is <00:05:04.640>what <00:05:04.733>I <00:05:04.826>believe <00:05:04.920>to <00:05:05.013>be <00:05:05.106>an <00:05:05.200>example <00:05:05.293>of <00:05:05.386>a <00:05:05.480>good <00:05:05.573>reason <00:05:05.666>to <00:05:05.760>refactor,

82
00:05:09.340 --> 00:05:10.130
right?

83
00:05:10.130 --> 00:05:14.580
<00:05:10.130>That <00:05:10.237>module <00:05:10.345>is <00:05:10.453>so <00:05:10.560>unreadable <00:05:10.668>that <00:05:10.776>only <00:05:10.883>two <00:05:10.991>old <00:05:11.099>timers <00:05:11.206>in <00:05:11.314>the <00:05:11.422>entire <00:05:11.530>company

84
00:05:15.050 --> 00:05:17.820
<00:05:15.050>know <00:05:15.205>how <00:05:15.361>to <00:05:15.516>fix <00:05:15.672>issues. <00:05:15.827>This <00:05:15.983>puts <00:05:16.138>us <00:05:16.294>at <00:05:16.450>risk,

85
00:05:19.640 --> 00:05:22.880
<00:05:19.640>I <00:05:19.780>think <00:05:19.919>at <00:05:20.060>least <00:05:20.200>good <00:05:20.340>reason, <00:05:20.479>a <00:05:20.620>bad <00:05:20.760>reason <00:05:20.900>to <00:05:21.039>refactor,

86
00:05:22.940 --> 00:05:25.680
<00:05:22.940>and <00:05:23.140>one <00:05:23.340>that <00:05:23.540>I <00:05:23.740>have <00:05:23.940>seen <00:05:24.140>happen <00:05:24.340>many,

87
00:05:25.870 --> 00:05:29.360
<00:05:25.870>many <00:05:26.045>times <00:05:26.220>over <00:05:26.395>is <00:05:26.570>I <00:05:26.745>went <00:05:26.920>to <00:05:27.095>a <00:05:27.270>conference,

88
00:05:30.080 --> 00:05:33.360
<00:05:30.080>I <00:05:30.235>learned <00:05:30.391>this <00:05:30.546>really <00:05:30.702>cool <00:05:30.857>paradigm <00:05:31.013>or <00:05:31.168>really <00:05:31.324>cool <00:05:31.479>framework,

89
00:05:33.900 --> 00:05:36.560
<00:05:33.900>so <00:05:34.075>I <00:05:34.250>need <00:05:34.424>to <00:05:34.599>rewrite <00:05:34.775>everything <00:05:34.950>to <00:05:35.125>fix <00:05:35.299>it,

90
00:05:36.700 --> 00:05:41.040
<00:05:36.700>to <00:05:36.840>make <00:05:36.979>it <00:05:37.120>use <00:05:37.260>this <00:05:37.400>new <00:05:37.539>fantastic <00:05:37.680>paradigm. <00:05:37.820>Um, <00:05:37.960>even <00:05:38.099>sourcing,

91
00:05:41.600 --> 00:05:42.560
<00:05:41.600>I <00:05:42.032>remember, <00:05:42.464>uh,

92
00:05:42.560 --> 00:05:47.420
<00:05:42.560>being <00:05:42.676>an <00:05:42.793>example <00:05:42.910>of <00:05:43.026>that <00:05:43.143>and <00:05:43.260>then <00:05:43.376>something <00:05:43.493>that <00:05:43.610>maybe <00:05:43.726>it's <00:05:43.843>not <00:05:43.960>that

93
00:05:47.420 --> 00:05:51.540
<00:05:47.420>clear. <00:05:47.527>Um, <00:05:47.635>it'll <00:05:47.743>run <00:05:47.850>twice <00:05:47.958>as <00:05:48.066>fast <00:05:48.173>if <00:05:48.281>you <00:05:48.389>use <00:05:48.496>a <00:05:48.604>different <00:05:48.712>data <00:05:48.820>structure.

94
00:05:51.880 --> 00:05:56.500
<00:05:51.880>So <00:05:51.996>you, <00:05:52.113>let's <00:05:52.230>keep <00:05:52.346>aside <00:05:52.463>the <00:05:52.580>fact <00:05:52.696>that <00:05:52.813>it <00:05:52.930>changes <00:05:53.046>behavior <00:05:53.163>a <00:05:53.280>bit.

95
00:05:56.500 --> 00:05:58.360
<00:05:56.500>So <00:05:56.700>you <00:05:56.900>can <00:05:57.100>argue <00:05:57.300>it's <00:05:57.500>not <00:05:57.700>really <00:05:57.900>factoring,

96
00:05:58.700 --> 00:06:01.920
<00:05:58.700>but <00:05:58.827>is <00:05:58.954>this <00:05:59.081>a <00:05:59.209>good <00:05:59.336>reason <00:05:59.463>to <00:05:59.590>refactor <00:05:59.718>or <00:05:59.845>is <00:05:59.972>it <00:06:00.099>not?

97
00:06:03.240 --> 00:06:06.660
<00:06:03.240>So <00:06:03.415>the <00:06:03.590>answer <00:06:03.765>in <00:06:03.940>my <00:06:04.115>opinion <00:06:04.290>is <00:06:04.465>it <00:06:04.640>depends.

98
00:06:06.800 --> 00:06:11.020
<00:06:06.800>It <00:06:06.927>depends <00:06:07.054>because <00:06:07.181>if <00:06:07.309>the <00:06:07.436>difference <00:06:07.563>is <00:06:07.690>from <00:06:07.818>two <00:06:07.945>seconds <00:06:08.072>to <00:06:08.200>one,

99
00:06:11.310 --> 00:06:12.660
<00:06:11.310>maybe <00:06:11.613>the <00:06:11.917>user <00:06:12.221>will <00:06:12.525>see,

100
00:06:12.750 --> 00:06:17.740
<00:06:12.750>maybe <00:06:12.877>it's <00:06:13.004>worth <00:06:13.131>doing <00:06:13.259>this <00:06:13.386>two <00:06:13.513>milliseconds <00:06:13.640>to <00:06:13.768>one <00:06:13.895>millisecond <00:06:14.022>Depends, <00:06:14.150>right?

101
00:06:17.740 --> 00:06:20.460
<00:06:17.740>Depends. <00:06:17.973>Sometimes <00:06:18.206>it <00:06:18.440>matters, <00:06:18.673>sometimes <00:06:18.906>it <00:06:19.140>doesn't.

102
00:06:20.560 --> 00:06:24.760
<00:06:20.560>So <00:06:20.676>I <00:06:20.793>showed <00:06:20.910>you <00:06:21.026>what <00:06:21.143>I <00:06:21.260>think <00:06:21.376>are <00:06:21.493>good <00:06:21.610>and <00:06:21.726>bad <00:06:21.843>examples. <00:06:21.960>Now,

103
00:06:25.300 --> 00:06:26.840
<00:06:25.300>how <00:06:25.531>do <00:06:25.762>you <00:06:25.993>really <00:06:26.224>tell <00:06:26.455>the <00:06:26.686>difference?

104
00:06:27.460 --> 00:06:31.040
<00:06:27.460>So <00:06:27.635>this <00:06:27.810>is <00:06:27.984>the <00:06:28.159>difference <00:06:28.335>from <00:06:28.510>the <00:06:28.685>product <00:06:28.859>perspective.

105
00:06:31.320 --> 00:06:36.200
<00:06:31.320>A <00:06:31.427>good <00:06:31.535>refactoring <00:06:31.643>has <00:06:31.750>to <00:06:31.858>have <00:06:31.966>business <00:06:32.073>value. <00:06:32.181>So <00:06:32.289>everything <00:06:32.396>you <00:06:32.504>do <00:06:32.612>at <00:06:32.719>work,

106
00:06:36.610 --> 00:06:40.040
<00:06:36.610>everything <00:06:36.765>you <00:06:36.921>are <00:06:37.076>getting <00:06:37.232>paid <00:06:37.387>for <00:06:37.543>should <00:06:37.698>have <00:06:37.854>business <00:06:38.010>value.

107
00:06:40.350 --> 00:06:42.890
<00:06:40.350>Refactoring <00:06:40.700>is <00:06:41.050>no <00:06:41.400>different. <00:06:41.750>Now,

108
00:06:43.430 --> 00:06:47.970
<00:06:43.430>is <00:06:43.546>it <00:06:43.663>really <00:06:43.780>possible <00:06:43.896>to <00:06:44.013>even <00:06:44.130>talk <00:06:44.246>about <00:06:44.363>the <00:06:44.480>business <00:06:44.596>value <00:06:44.713>of <00:06:44.830>refactoring?

109
00:06:48.450 --> 00:06:53.170
<00:06:48.450>I <00:06:48.566>have <00:06:48.683>a <00:06:48.800>few <00:06:48.916>hints, <00:06:49.033>let's <00:06:49.150>say, <00:06:49.266>uh, <00:06:49.383>about <00:06:49.500>measuring <00:06:49.616>that. <00:06:49.733>So <00:06:49.849>one,

110
00:06:53.710 --> 00:06:56.450
<00:06:53.710>as <00:06:53.849>I <00:06:53.989>said <00:06:54.130>already, <00:06:54.270>if <00:06:54.409>it <00:06:54.549>does <00:06:54.690>not <00:06:54.830>have <00:06:54.969>business <00:06:55.109>impact,

111
00:06:56.910 --> 00:06:58.610
<00:06:56.909>it <00:06:57.189>shouldn't <00:06:57.469>be <00:06:57.749>done <00:06:58.030>a <00:06:58.309>period.

112
00:06:59.190 --> 00:07:03.010
<00:06:59.190>So <00:06:59.330>examples <00:06:59.469>of <00:06:59.610>what <00:06:59.750>you <00:06:59.890>can <00:07:00.030>measure <00:07:00.170>as <00:07:00.310>the <00:07:00.450>business <00:07:00.590>impact,

113
00:07:03.030 --> 00:07:06.370
<00:07:03.030>as <00:07:03.185>the <00:07:03.341>business <00:07:03.496>value <00:07:03.652>of <00:07:03.807>doing <00:07:03.963>refactoring <00:07:04.118>fewer <00:07:04.274>production <00:07:04.429>issues.

114
00:07:06.370 --> 00:07:08.530
<00:07:06.370>After <00:07:06.545>each <00:07:06.720>release, <00:07:06.895>the <00:07:07.070>code <00:07:07.245>is <00:07:07.420>easier <00:07:07.595>to <00:07:07.770>read.

115
00:07:08.780 --> 00:07:10.930
<00:07:08.780>Developers <00:07:09.013>make <00:07:09.246>less <00:07:09.479>mistakes <00:07:09.713>because <00:07:09.946>of <00:07:10.179>that,

116
00:07:11.520 --> 00:07:16.210
<00:07:11.520>it's <00:07:11.627>better <00:07:11.735>you <00:07:11.843>can <00:07:11.950>measure <00:07:12.058>that <00:07:12.166>or <00:07:12.273>shorter <00:07:12.381>time <00:07:12.489>from <00:07:12.596>hiring <00:07:12.704>to <00:07:12.812>first <00:07:12.919>commit.

117
00:07:16.430 --> 00:07:17.850
<00:07:16.430>So <00:07:16.749>you <00:07:17.069>hire <00:07:17.388>a <00:07:17.708>person,

118
00:07:18.270 --> 00:07:23.010
<00:07:18.270>it <00:07:18.377>used <00:07:18.485>to <00:07:18.593>take <00:07:18.700>them <00:07:18.808>a <00:07:18.916>month <00:07:19.023>to <00:07:19.131>feel <00:07:19.239>comfortable <00:07:19.346>to <00:07:19.454>just <00:07:19.562>commit <00:07:19.669>something,

119
00:07:23.550 --> 00:07:26.970
<00:07:23.550>but <00:07:23.690>now, <00:07:23.830>uh, <00:07:23.970>it <00:07:24.110>takes <00:07:24.250>them <00:07:24.390>a <00:07:24.530>week <00:07:24.670>and <00:07:24.810>it's <00:07:24.950>readable.

120
00:07:26.970 --> 00:07:31.310
<00:07:26.970>They <00:07:27.110>know <00:07:27.250>what <00:07:27.390>they're <00:07:27.530>doing. <00:07:27.670>It's <00:07:27.810>a <00:07:27.950>very <00:07:28.090>clear <00:07:28.230>value. <00:07:28.370>Uh,

121
00:07:31.310 --> 00:07:35.870
<00:07:31.310>then <00:07:31.410>I <00:07:31.510>also <00:07:31.610>want <00:07:31.710>to <00:07:31.810>make <00:07:31.910>this <00:07:32.010>point <00:07:32.110>that <00:07:32.210>technical <00:07:32.310>goals <00:07:32.410>of <00:07:32.510>refactoring <00:07:32.610>have <00:07:32.710>to

122
00:07:35.870 --> 00:07:39.230
<00:07:35.870>be <00:07:36.025>clear. <00:07:36.181>So <00:07:36.336>this <00:07:36.492>is <00:07:36.647>on <00:07:36.803>engineering. <00:07:36.958>Uh, <00:07:37.114>for <00:07:37.270>instance,

123
00:07:39.330 --> 00:07:43.830
<00:07:39.330>the <00:07:39.437>developers <00:07:39.545>need <00:07:39.653>to <00:07:39.760>know <00:07:39.868>where <00:07:39.976>to <00:07:40.083>stop, <00:07:40.191>right? <00:07:40.299>When <00:07:40.406>is <00:07:40.514>this <00:07:40.622>code <00:07:40.729>refactored?

124
00:07:43.830 --> 00:07:45.710
<00:07:43.830>Where <00:07:44.063>is <00:07:44.296>it <00:07:44.530>good <00:07:44.763>enough? <00:07:44.996>For <00:07:45.229>instance,

125
00:07:46.250 --> 00:07:49.950
<00:07:46.250>we <00:07:46.405>always <00:07:46.561>apply <00:07:46.716>a <00:07:46.872>certain <00:07:47.027>design <00:07:47.183>pattern <00:07:47.338>in <00:07:47.494>certain <00:07:47.650>conditions,

126
00:07:50.490 --> 00:07:54.750
<00:07:50.490>or <00:07:50.617>we <00:07:50.744>migrate <00:07:50.871>a <00:07:50.999>file <00:07:51.126>from <00:07:51.253>JavaScript <00:07:51.380>like <00:07:51.508>pure <00:07:51.635>JavaScript <00:07:51.762>to <00:07:51.890>cript.

127
00:07:55.040 --> 00:07:58.070
<00:07:55.040>These <00:07:55.273>are <00:07:55.506>our <00:07:55.740>technical <00:07:55.973>goals. <00:07:56.206>And <00:07:56.440>finally,

128
00:07:58.800 --> 00:08:03.510
<00:07:58.800>there <00:07:59.000>actually <00:07:59.200>exist <00:07:59.400>prioritization <00:07:59.600>frameworks <00:07:59.800>for <00:08:00.000>those <00:08:00.200>scenarios.

129
00:08:03.810 --> 00:08:08.710
<00:08:03.810>One <00:08:03.917>of <00:08:04.025>them <00:08:04.133>is <00:08:04.240>the <00:08:04.348>cost <00:08:04.456>of <00:08:04.563>delay <00:08:04.671>prioritization. <00:08:04.779>How <00:08:04.886>it <00:08:04.994>works. <00:08:05.102>You, <00:08:05.210>val,

130
00:08:08.710 --> 00:08:12.670
<00:08:08.710>you <00:08:08.817>try <00:08:08.925>to <00:08:09.033>weigh <00:08:09.140>two <00:08:09.248>different <00:08:09.356>things <00:08:09.463>like <00:08:09.571>refactoring <00:08:09.679>and <00:08:09.786>a <00:08:09.894>new <00:08:10.002>feature <00:08:10.109>being

131
00:08:12.670 --> 00:08:17.630
<00:08:12.670>built. <00:08:12.777>And <00:08:12.885>now <00:08:12.993>in <00:08:13.100>three <00:08:13.208>months <00:08:13.316>from <00:08:13.423>today, <00:08:13.531>if <00:08:13.639>the <00:08:13.746>refactoring <00:08:13.854>is <00:08:13.962>not <00:08:14.070>done,

132
00:08:18.240 --> 00:08:22.190
<00:08:18.240>we'll <00:08:18.347>lose <00:08:18.455>that <00:08:18.563>amount <00:08:18.670>of <00:08:18.778>money. <00:08:18.886>For <00:08:18.993>instance, <00:08:19.101>on <00:08:19.209>server <00:08:19.316>costs. <00:08:19.424>We <00:08:19.532>could <00:08:19.640>save,

133
00:08:22.210 --> 00:08:24.310
<00:08:22.210>but <00:08:22.385>we <00:08:22.560>are <00:08:22.734>not <00:08:22.909>saving <00:08:23.085>because <00:08:23.260>we <00:08:23.435>didn't <00:08:23.609>refactor.

134
00:08:25.010 --> 00:08:27.110
<00:08:25.010>Or <00:08:25.243>if <00:08:25.476>this <00:08:25.710>feature <00:08:25.943>is <00:08:26.176>not <00:08:26.409>delivered,

135
00:08:27.480 --> 00:08:31.550
<00:08:27.480>maybe <00:08:27.587>some <00:08:27.695>users <00:08:27.803>will <00:08:27.910>leave <00:08:28.018>and <00:08:28.126>this <00:08:28.233>will <00:08:28.341>cost <00:08:28.449>us <00:08:28.556>an <00:08:28.664>amount <00:08:28.772>of <00:08:28.880>money.

136
00:08:32.050 --> 00:08:36.910
<00:08:32.049>So <00:08:32.166>this <00:08:32.283>is <00:08:32.400>one <00:08:32.516>of <00:08:32.633>the <00:08:32.750>ways <00:08:32.866>that <00:08:32.983>you <00:08:33.099>can <00:08:33.216>approach <00:08:33.333>measuring <00:08:33.449>the

137
00:08:37.070 --> 00:08:40.240
<00:08:37.070>business <00:08:37.245>value <00:08:37.420>and <00:08:37.595>then <00:08:37.770>prioritizing <00:08:37.945>based <00:08:38.120>of <00:08:38.295>it. <00:08:38.470>Um,

138
00:08:41.010 --> 00:08:45.160
<00:08:41.010>final <00:08:41.137>words <00:08:41.264>of <00:08:41.391>advice. <00:08:41.519>Uh, <00:08:41.646>one <00:08:41.773>of <00:08:41.900>them <00:08:42.028>is <00:08:42.155>targeted <00:08:42.282>at <00:08:42.409>engineers.

139
00:08:45.460 --> 00:08:49.480
<00:08:45.460>One <00:08:45.635>product <00:08:45.810>people. <00:08:45.985>So <00:08:46.160>the <00:08:46.335>one <00:08:46.510>for <00:08:46.685>engineers, <00:08:46.860>refactoring,

140
00:08:49.510 --> 00:08:53.600
<00:08:49.510>like <00:08:49.637>everything <00:08:49.764>else <00:08:49.891>that <00:08:50.019>developers <00:08:50.146>work <00:08:50.273>on <00:08:50.400>needs <00:08:50.528>to <00:08:50.655>have <00:08:50.782>business <00:08:50.910>value.

141
00:08:54.260 --> 00:08:54.840
<00:08:54.260>So <00:08:54.521>you <00:08:54.782>need

142
00:08:54.840 --> 00:08:59.720
<00:08:54.840>To <00:08:54.947>understand <00:08:55.055>very <00:08:55.163>well <00:08:55.270>why <00:08:55.378>you <00:08:55.486>are <00:08:55.593>doing <00:08:55.701>this <00:08:55.809>and <00:08:55.916>what <00:08:56.024>problem <00:08:56.132>you <00:08:56.240>are

143
00:08:59.720 --> 00:09:01.960
<00:08:59.720>trying <00:08:59.953>to <00:09:00.186>solve <00:09:00.420>by <00:09:00.653>doing <00:09:00.886>this. <00:09:01.120>Refactory,

144
00:09:02.710 --> 00:09:06.880
<00:09:02.710>just <00:09:02.817>to <00:09:02.925>make <00:09:03.033>it <00:09:03.140>nicer <00:09:03.248>to <00:09:03.356>look <00:09:03.463>at <00:09:03.571>is <00:09:03.679>not <00:09:03.786>an <00:09:03.894>actual <00:09:04.002>problem. <00:09:04.110>Um,

145
00:09:07.060 --> 00:09:11.080
<00:09:07.060>you <00:09:07.199>need <00:09:07.339>to <00:09:07.479>solve. <00:09:07.619>And <00:09:07.760>then <00:09:07.900>my <00:09:08.040>advice <00:09:08.180>to <00:09:08.319>product <00:09:08.459>managers,

146
00:09:11.190 --> 00:09:15.120
<00:09:11.190>it's <00:09:11.345>this <00:09:11.501>is <00:09:11.656>not <00:09:11.812>too <00:09:11.967>technical <00:09:12.123>for <00:09:12.278>you <00:09:12.434>to <00:09:12.590>understand.

147
00:09:15.580 --> 00:09:19.960
<00:09:15.580>So <00:09:15.696>if <00:09:15.813>developers <00:09:15.930>are <00:09:16.046>telling <00:09:16.163>you, <00:09:16.280>well, <00:09:16.396>we <00:09:16.513>need <00:09:16.630>to <00:09:16.746>refactor <00:09:16.863>and <00:09:16.980>like,

148
00:09:19.960 --> 00:09:23.450
<00:09:19.960>you <00:09:20.115>will <00:09:20.271>not <00:09:20.426>understand, <00:09:20.582>this <00:09:20.737>is <00:09:20.893>not <00:09:21.048>good <00:09:21.204>enough. <00:09:21.360>Um,

149
00:09:24.030 --> 00:09:28.810
<00:09:24.030>and <00:09:24.157>something <00:09:24.284>I <00:09:24.411>learned <00:09:24.539>in <00:09:24.666>my <00:09:24.793>career <00:09:24.920>is <00:09:25.048>if <00:09:25.175>you <00:09:25.302>don't <00:09:25.430>understand

150
00:09:28.810 --> 00:09:31.810
<00:09:28.810>something, <00:09:28.965>there <00:09:29.121>are <00:09:29.276>two <00:09:29.432>possible <00:09:29.587>options, <00:09:29.743>at <00:09:29.898>least <00:09:30.054>two <00:09:30.209>options.

151
00:09:32.350 --> 00:09:34.970
<00:09:32.350>One <00:09:32.550>option <00:09:32.750>is <00:09:32.950>you <00:09:33.150>are <00:09:33.350>not <00:09:33.550>smart <00:09:33.750>enough.

152
00:09:35.630 --> 00:09:40.370
<00:09:35.630>The <00:09:35.746>other <00:09:35.863>option <00:09:35.980>is <00:09:36.096>it <00:09:36.213>doesn't <00:09:36.330>make <00:09:36.446>sense. <00:09:36.563>So <00:09:36.680>make <00:09:36.796>them <00:09:36.913>under, <00:09:37.030>make,

153
00:09:40.400 --> 00:09:44.850
<00:09:40.400>make <00:09:40.487>them <00:09:40.574>explain <00:09:40.662>it <00:09:40.750>to <00:09:40.837>you <00:09:40.925>so <00:09:41.012>that <00:09:41.100>you <00:09:41.187>understand <00:09:41.275>and <00:09:41.362>that <00:09:41.449>this <00:09:41.537>is <00:09:41.625>what <00:09:41.712>I <00:09:41.800>want

154
00:09:44.850 --> 00:09:45.370
<00:09:44.850>to <00:09:45.006>leave <00:09:45.162>you <00:09:45.318>with.