-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
256 lines (245 loc) · 14.5 KB
/
Copy pathindex.html
File metadata and controls
256 lines (245 loc) · 14.5 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html>
<body>
<h1>Committing with Discipline</h1>
<div id="articleContent" class="clearfix">
<div id="articleHeader" class="sectionHeader">
<h1>
<a href="/articles/article.aspx?p=1715058">The Clean Coder: Saying Yes</a>
</h1>
<a rel="author" href="/authors/bio.aspx?a=361a5e70-f1e2-432b-9928-b30b4742ae80">
<img src="http://ptgmedia.pearsoncmg.com/authors/m/martin_robert_c/martin_robert_c_e.jpg" alt="Robert C. Martin" class="author">
</a>
<ul>
<li class="authorName">
By
<a rel="author" href="/authors/bio.aspx?a=361a5e70-f1e2-432b-9928-b30b4742ae80">Robert C. Martin</a>
</li>
<li>May 31, 2011</li>
</ul>
</div>
<div class="articleTools">
<div id="articleTOC">
<p>
<a href="javascript:void(0);" title="Toggle Open Article Table of Contents">
<img src="/display/InformIT/images/icons/toc_16.png" id="toggle" alt="Toggle Open Article Table of Contents">
</a>
<a href="javascript:void(0);" title="Toggle Open Article Table of Contents">Contents</a>
</p>
<div id="articleTOCList" class="closed sectionHeader" style="display: none;">
<p>
<a href="javascript:hideTOC();" class="x" title="Close Table of Contents">
<img src="/display/InformIT/images/icons/toc_16.png" id="toggle" alt="Close Table of Contents">
</a>
<a href="javascript:hideTOC();" class="x" title="Close Table of Contents">Contents</a>
</p>
<ol>
<li>
<a href="/articles/article.aspx?p=1715058">A Language of Commitment</a>
</li>
<li>
Learning How to Say Yes </li>
<li>
<a href="/articles/article.aspx?p=1715058&seqNum=3">Conclusion</a>
</li>
</ol>
<a href="javascript:hideTOC();" class="toggleClose" title="Close Table of Contents">
<img src="/display/InformIT/images/icons/close_window_16.png" alt="Close Table of Contents">
</a>
</div>
</div>
<div class="articleInteraction">
<ul>
<li>
<a href="/articles/printerfriendly.aspx?p=1715058" title="Print">
<img src="/display/InformIT/images/icons/print_16.png" alt="Print">
</a>
<a href="/articles/printerfriendly.aspx?p=1715058" title="Print">
<span>Print</span>
</a>
</li>
<li>
<script type="text/javascript">
addthis_pub = 'informit';
addthis_logo = 'http://www.informit.com/display/InformIT/images/header/informit.png';
addthis_logo_background = '596770';
addthis_logo_color = '596770';
addthis_brand = 'informIT';
addthis_options = 'email, delicious, digg, facebook, google, newsvine, reddit, slashdot, stumbleupon, technorati, twitter, more';
</script>
<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()">
<img src="/display/InformIT/images/icons/share_16.png" width="16" height="16" border="0" alt="Share This">
</a>
<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()">
<span>Share This</span>
</a>
<script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<div style="visibility: hidden; height: 1px; width: 1px; position: absolute; z-index: 100000;" id="_atssh">
<iframe id="_atssh632" title="AddThis utility frame" style="height: 1px; width: 1px; position: absolute; z-index: 100000; border-top-color: currentColor; border-left-color: currentColor; border-right-color: currentColor; border-bottom-color: currentColor; border-top-width: 0px; border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-style: none; border-left-style: none; border-right-style: none; border-bottom-style: none; left: 0px; top: 0px;" src="//s7.addthis.com/static/r07/sh142.html#iit=1388403878846&tmr=load%3D1388403877617%26core%3D1388403877727%26main%3D1388403878815%26ifr%3D1388403878846&cb=0&cdn=0&chr=utf-8&kw=&ab=-&dh=www.informit.com&dr=http%3A%2F%2Fwww.google.com%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3D%26esrc%3Ds%26source%3Dweb%26cd%3D1%26ved%3D0CCsQFjAA%26url%3Dhttp%253A%252F%252Fwww.informit.com%252Farticles%252Farticle.aspx%253Fp%253D1715058%2526seqNum%253D2%26ei%3DnFzBUr34Icus7QbhlIDoAQ%26usg%3DAFQjCNG2AANQ58kJFYS4qZD5eG63ULJt1g%26sig2%3D-625lTlfaihEUWJuUJRfXA%26bvm%3Dbv.58187178%2Cd.ZGU&du=http%3A%2F%2Fwww.informit.com%2Farticles%2Farticle.aspx%3Fp%3D1715058%26seqNum%3D2&dt=Learning%20How%20to%20Say%20Yes%20%7C%20The%20Clean%20Coder%3A%20Saying%20Yes%20%7C%20InformIT&dbg=0&md=0&cap=tc%3D0%26ab%3D0&inst=1&vcl=0&jsl=33&prod=true&lng=en&ogt=&pc=men&pub=informit&ssl=0&sid=52c15ca502470991&srpl=1&srcs=1&srd=1&srf=1&srx=1&ver=300&xck=0&xtr=0&og=&aa=0&rev=125513&ct=1&xld=1&xd=1"></iframe>
</div>
<script type="text/javascript" src="http://s7.addthis.com/static/r07/core114.js"></script>
</li>
<li class="last">
<a href="#articleDiscussion" title="Discuss">
<img src="/display/InformIT/images/icons/discuss_16.png" alt="Discuss">
</a>
<a href="#articleDiscussion" title="Discuss">
<span>Discuss</span>
</a>
</li>
</ul>
</div>
<div class="pagination">
<a class="paginationPrevious" href="/articles/article.aspx?p=1715058">< Back</a>
<span class="paginationLocation">
<strong>Page 2</strong>
of 3
</span>
<a class="paginationNext" href="/articles/article.aspx?p=1715058&seqNum=3">Next ></a>
</div>
</div>
<div id="articleText">
<div class="relatedBook">
<div class="header graydient">
<h3>This chapter is from the book</h3>
</div>
<div class="productArea graydient clearfix">
<a href="/store/clean-coder-a-code-of-conduct-for-professional-programmers-9780137081073?w_ptgrevartcl=The+Clean+Coder%3a+Saying+Yes_1715058">
<img src="/ShowCover.aspx?isbn=9780137081073&type=d" alt="Clean Coder, The: A Code of Conduct for Professional Programmers" class="product">
</a>
<a href="/store/clean-coder-a-code-of-conduct-for-professional-programmers-9780137081073?w_ptgrevartcl=The+Clean+Coder%3a+Saying+Yes_1715058" class="title">Clean Coder, The: A Code of Conduct for Professional Programmers</a>
<br>
<br>
<a href="/store/clean-coder-a-code-of-conduct-for-professional-programmers-9780137081073?w_ptgrevartcl=The+Clean+Coder%3a+Saying+Yes_1715058" class="button">Learn More</a>
<a href="/buy.aspx?isbn=9780137081073&w_ptgrevartcl=The+Clean+Coder%3a+Saying+Yes_1715058" class="buy button">
<span class="ss-icon">?</span>
Buy
</a>
</div>
</div>
<h2>Learning How to Say “Yes”</h2>
<p>I asked Roy to contribute that article because it struck a chord within me. I’ve been preaching about learning how to say
no for some time. But it is just as important to learn how to say yes.
</p>
<h3>The Other Side of “Try”</h3>
<p>Let’s imagine that Peter is responsible for some modifications to the rating engine. He’s privately estimated that these modifications
will take him five or six days. He also thinks that writing the documentation for the modifications will take a few hours.
On Monday morning his manager, Marge, asks him for status.
</p>
<p>Marge: “Peter, will you have the rating engine mods done by Friday?”</p>
<p>Peter: “I think that’s doable.”</p>
<p>Marge: “Will that include the documentation?”</p>
<p>Peter: “I’ll try to get that done as well.”</p>
<p>Perhaps Marge can’t hear the dithering in Peter’s statements, but he’s certainly not making much of a commitment. Marge is
asking questions that demand boolean answers but Peter’s boolean responses are fuzzy.
</p>
<p>Notice the abuse of the word try. In the last chapter we used the “extra effort” definition of try. Here, Peter is using the
“maybe, maybe not” definition.
</p>
<p>Peter would be better off responding like this:</p>
<p>Marge: “Peter, will you have the rating engine mods done by Friday?”</p>
<p>Peter: “Probably, but it might be Monday.”</p>
<p>Marge: “Will that include the documentation?”</p>
<p>Peter: “The documentation will take me another few hours, so Monday is possible, but it might be as late as Tuesday.”</p>
<p>In this case Peter’s language is more honest. He is describing his own uncertainty to Marge. Marge may be able to deal with
that uncertainty. On the other hand, she might not.
</p>
<h4>Committing with Discipline</h4>
<p>Marge: “Peter, I need a definite yes or no. Will you have the rating engine finished and documented by Friday?”</p>
<p>This is a perfectly fair question for Marge to ask. She’s got a schedule to maintain, and she needs a binary answer about
Friday. How should Peter respond?
</p>
<p>
Peter: “In that case, Marge, I’ll have to say no. The soonest I can be
<em>sure</em>
that I’ll be done with the mods and the docs is Tuesday.”
</p>
<p>Marge: “You are committing to Tuesday?”</p>
<p>Peter: “Yes, I will have it all ready on Tuesday.”</p>
<p>But what if Marge really needs the modifications and documentation done by Friday?</p>
<p>Marge: “Peter, Tuesday gives me a real problem. Willy, our tech writer, will be available on Monday. He’s got five days to finish
up the user guide. If I don’t have the rating engine docs by Monday morning, he’ll never get the manual done on time. Can
you do the docs first?”
</p>
<p>Peter: “No, the mods have to come first, because we generate the docs from the output of the test runs.”</p>
<p>Marge: “Well, isn’t there some way you can finish up the mods and the docs before Monday morning?”</p>
<p>
Now Peter has a decision to make. There is a good chance he’ll be done with the rate engine modifications on Friday, and he
might even be able to finish up the docs before he goes home for the weekend. He
<em>could</em>
do a few hours of work on Saturday too if things take longer than he hopes. So what should he tell Marge?
</p>
<p>Peter: “Look Marge, there’s a good chance that I can get everything done by Monday morning if I put in a few extra hours on Saturday.”</p>
<p>Does that solve Marge’s problem? No, it simply changes the odds, and that’s what Peter needs to tell her.</p>
<p>Marge: “Can I count on Monday morning then?”</p>
<p>Peter: “Probably, but not definitely.”</p>
<p>That might not be good enough for Marge.</p>
<p>
Marge: “Look, Peter, I really need a definite on this. Is there
<em>any</em>
way you can commit to get this done before Monday morning?”
</p>
<p>Peter might be tempted to break discipline at this point. He might be able to get done faster if he doesn’t write his tests.
He might be able to get done faster if he doesn’t refactor. He might be able to get done faster if he doesn’t run the full
regression suite.
</p>
<p>
This is where the professional draws the line. First of all, Peter is just wrong about his suppositions. He
<em>won’t</em>
get done faster if he doesn’t write his tests. He
<em>won’t</em>
get done faster if he doesn’t refactor. He
<em>won’t</em>
get done faster if he omits the full regression suite. Years of experience have taught us that breaking disciplines only
slows us down.
</p>
<p>But secondly, as a professional he has a responsibility to maintain certain standards. His code needs to be tested, and needs
to have tests. His code needs to be clean. And he has to be sure he hasn’t broken anything else in the system.
</p>
<p>Peter, as a professional, has already made a commitment to maintain these standards. All other commitments he makes should
be subordinate to that. So this whole line of reasoning needs to aborted.
</p>
<p>Peter: “No, Marge, there’s really no way I can be certain about any date before Tuesday. I’m sorry if that messes up your schedule,
but it’s just the reality we’re faced with.”
</p>
<p>Marge: “Damn. I was really counting on bringing this one in sooner. You’re sure?”</p>
<p>Peter: “I’m sure that it might be as late as Tuesday, yes.”</p>
<p>Marge: “OK, I guess I’ll go talk to Willy to see if he can rearrange his schedule.”</p>
<p>In this case Marge accepted Peter’s answer and started hunting for other options. But what if all Marge’s options have been
exhausted? What if Peter were the last hope?
</p>
<p>Marge: “Peter, look, I know this is a huge imposition, but I really need you to find a way to get this all done by Monday morning.
It’s really critical. Isn’t there something you can do?”
</p>
<p>
So now Peter starts to think about working some significant overtime, and probably most of the weekend. He needs to be very
honest with himself about his stamina and reserves. It’s easy to
<em>say</em>
you’ll get a lot done on the weekends, it’s a lot harder to actually muster enough energy to do high-quality work.
</p>
<p>Professionals know their limits. They know how much overtime they can effectively apply, and they know what the cost will
be.
</p>
<p>In this case Peter feels pretty confident that a few extra hours during the week and some time on the weekend will be sufficient.</p>
<p>Peter: “OK, Marge, I’ll tell you what. I’ll call home and clear some overtime with my family. If they are OK with it, then I’ll get
this task done by Monday morning. I’ll even come in on Monday morning to make sure everything goes smoothly with Willy. But
then I’ll go home and won’t be back until Wednesday. Deal?”
</p>
<p>This is perfectly fair. Peter knows that he can get the modifications and documents done if he works the overtime. He also
knows he’ll be useless for a couple of days after that.
</p>
</div>
<div class="articleToolsSecond">
<div class="pagination">
<a class="paginationPrevious" href="/articles/article.aspx?p=1715058">< Back</a>
<span class="paginationLocation">
<strong>Page 2</strong>
of 3
</span>
<a class="paginationNext" href="/articles/article.aspx?p=1715058&seqNum=3">Next ></a>
</div>
<a href="http://www.informit.com/articles/article.aspx?p=1715058&seqNum=2" >Pirated from</a>
</div>
</div>
</body>
</html>