about summary refs log tree commit diff
path: root/usth/ICT2.7/P4L5 Software Refactoring Subtitles/6 - History of Refactoring - lang_en_vs4.srt
blob: 3405b6587f6709296565a61dde3a29b09c210928 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
1
00:00:00,110 --> 00:00:02,340
So if you follow my class so far, you know that

2
00:00:02,340 --> 00:00:04,570
I like to give a little bit of history when I talk

3
00:00:04,570 --> 00:00:06,900
about a specific topic. So I'm going to do the same also

4
00:00:06,900 --> 00:00:09,900
in this case for refactoring. I'm going to start by mentioning, the fact

5
00:00:09,900 --> 00:00:13,440
that refactoring is something that programmers have always done. I gave

6
00:00:13,440 --> 00:00:16,300
you a trivial example just a minute ago of what refactoring is.

7
00:00:16,300 --> 00:00:18,080
So even more complicated refactorings are

8
00:00:18,080 --> 00:00:20,880
something that are commonplace for developers.

9
00:00:20,880 --> 00:00:23,110
Somehow refactoring is especially important in

10
00:00:23,110 --> 00:00:25,240
the context of object-oriented languages and

11
00:00:25,240 --> 00:00:28,080
probably it's because the object-oriented features are well suited to

12
00:00:28,080 --> 00:00:31,640
make designs flexible and reusable. Because of the fact that help

13
00:00:31,640 --> 00:00:35,120
encapsulation, information hiding, and so they make it easier to

14
00:00:35,120 --> 00:00:38,330
modify something without changing the functionality that it provides to the

15
00:00:38,330 --> 00:00:40,960
outside world. However, you should keep in mind that refactoring

16
00:00:40,960 --> 00:00:44,330
is really not specific to object oriented languages, you can also

17
00:00:44,330 --> 00:00:47,320
refactor other languages, it's just more common to see it in

18
00:00:47,320 --> 00:00:50,450
that context. So one of the first examples of a specific

19
00:00:50,450 --> 00:00:53,630
discussion of what the refactorings are is Opdyke's PhD

20
00:00:53,630 --> 00:00:57,710
thesis in 1990. Which discusses refactorings for small talk.

21
00:00:57,710 --> 00:00:59,360
And some of you might be familiar with small

22
00:00:59,360 --> 00:01:02,600
talk, which is a specific objectory language. And in

23
00:01:02,600 --> 00:01:06,590
more recent times, refactoring's becoming increasing popular due to

24
00:01:06,590 --> 00:01:10,370
lightweight development methodoogies, due to agile development, which is

25
00:01:10,370 --> 00:01:12,630
something that we just discussed in this class. For

26
00:01:12,630 --> 00:01:15,830
example, when we talked about extreme programming, we mentioned refactoring

27
00:01:15,830 --> 00:01:17,950
a few times. And the reason why its so popular

28
00:01:17,950 --> 00:01:20,690
is because re-factoring is one of the practices that help.

29
00:01:20,690 --> 00:01:24,780
Making changes less expensive. And therefore adapt to changing requirements

30
00:01:24,780 --> 00:01:26,980
and changing environments more quickly.

31
00:01:26,980 --> 00:01:29,140
And continuing with historical perspective, one

32
00:01:29,140 --> 00:01:31,760
of the milestones in the history of re-factoring [INAUDIBLE] is

33
00:01:31,760 --> 00:01:34,660
a book by Martin Fowler. This is a book entitled

34
00:01:34,660 --> 00:01:37,610
Improving the Design of Existing [INAUDIBLE]. And it contains a

35
00:01:37,610 --> 00:01:41,320
catalog of refactorings, a list of bad smells, in code, and

36
00:01:41,320 --> 00:01:43,450
we're going to see what that mean exactly. Nothing to

37
00:01:43,450 --> 00:01:45,570
do with other kinds of bad smells. It talks about

38
00:01:45,570 --> 00:01:48,900
guidelines on when to apply refactoring. And finally, which is

39
00:01:48,900 --> 00:01:52,540
very useful, it provides example of code, before and after.

40
00:01:52,540 --> 00:01:54,660
Applying the refactoring and we're going to use more of the

41
00:01:54,660 --> 00:01:57,190
same style when discussing refactoring in the rest of this

42
00:01:57,190 --> 00:02:01,090
lesson. More specifically what we're discussing next, are some examples

43
00:02:01,090 --> 00:02:05,130
of refactoring and also some examples of code bad smells.