📄 listentothecode.html
字号:
<head><title>Listen To The Code</title></head><body><h1><img src="logo.gif"> Listen To The Code</h1>What does it mean to <a href="ListenToTheCode.html">ListenToTheCode</a>?
<p>When a highly experienced and knowledgeable developer "listens to code" that has problems, they should find that the <a href="CodeSmells.html">CodeSmells</a>.
<em>(OK, so we mix metaphors here. ;-)</em>
<p>This doesn't describe the "process" or the "feeling" at all. What about good code? What does it really mean to be one with the code?
<p><em>There are a few comments on "code listening" in <a href="http://c2.com/cgi/wiki?CouldExtremeProgrammingHaveArisenWithoutSmalltalk">CouldExtremeProgrammingHaveArisenWithoutSmalltalk</a> and <a href="http://c2.com/cgi/wiki?IsSmalltalkEasierToListenTo">IsSmalltalkEasierToListenTo</a>.</em>
<p><hr>
<p>The code you have written to date should help you write more code today. If it doesn't help, if you feel like you have to overcome it rather than exploit it, then it smells bad. Code that smells bad generally has overly complicated or otherwise inappropriate abstractions.
<p>Code can also be noisy. Noise in code can slow you down, but not in the same way as code that smells. The extra punctuation that most languages require counts as noise. Say you want to print <a href="http://c2.com/cgi/wiki?HelloWorld">HelloWorld</a>. You might find the need to type a string of terminators after the last letter. It might look like this:
<p><PRE> !\n");}^D
<p></PRE>That's noise. Lots of mindless comments or overly qualified names count as noise too. Noisy code isn't as bad as smelly code because we get used to the noise and ignore it. Smell doesn't go away so easily, in fact it will probably get worse.
<p>The metaphors work because they productively relate to our sense of the real world. If our food smells then we should probably eat with caution because it may have gone bad. If our dining room is noisy we should probably ignore it, or consider moving to a quieter locale someday. -- <a href="http://c2.com/cgi/wiki?WardCunningham">WardCunningham</a>
<hr>
<a href="ListenToTheCode.html">ListenToTheCode</a> is one instance of a general success strategy involving the use of feedback. There should be no products produced which are not part of a feedback loop, and code is no exception. In particular, producers should be aware of the 'sound' and 'smell' of the code they produce. They should want to be aware of these things. --<a href="http://c2.com/cgi/wiki?WaldenMathews">WaldenMathews</a>
<p>--
<p>But do try not to create an <a href="http://c2.com/cgi/wiki?ExtremelySpoiledChild">ExtremelySpoiledChild</a>. --<a href="http://c2.com/cgi/wiki?DaveWhipp">DaveWhipp</a>
<hr><a href="http://c2.com/cgi/wiki?edit=ListenToTheCode">EditText</a> of this page (last edited July 27, 2000)<br><a href="http://c2.com/cgi/wiki?FindPage&value=ListenToTheCode">FindPage</a> by browsing or searching<p><font color=gray size=-1>This page mirrored in <a href="index.html">ExtremeProgrammingRoadmap</a> as of March 31, 2001</font></body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -