<div dir="ltr"><div><div>I think "clever" here is meant in the "smart-ass" sense.<br></div><div><br></div><div>Let me take this smart-ass definition to be measured by how much you write "compressed" code (in the sense of Kolmogorov complexity, which incomputability fits well with the cleverness).<br>
</div>You have a compression function C: Program -> Program which compresses a program to the best /you/ can in reasonable time.<br>So we have, for any program p you write, the length l(p) is greater or equal to the length l(C(p)).<br>
Now say you are able to debug a program p only if l(p) > C(p) + N bits (we are in log scale, so addition instead of twice).<br>Then if you compress a program to the most /you/ can, i.e. you write a program p so that l(p) = C(p), then you're screwed for debugging it.<br>
<br></div><div>I.e., between "Never write the same code twice" and "Compress your programs as much as possible", there's a line one should not cross.<br></div><div><br></div>Laurent<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Mar 19, 2013 at 6:20 AM, Jos Koot <span dir="ltr"><<a href="mailto:jos.koot@gmail.com" target="_blank">jos.koot@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Courier New">Well, that may depend on how you define "clever code".
Surely it is clever to write well documented code that can easily be understood,
debugged, maintained and reused by yourself and by others. Understanding may
require knowledge of the discipline the code is written for, of
course. In my opinion it helps a lot first finishing the documentation and the
design (both user and 'inside' docs) before starting coding. With good and
well described design it is even possible to leave the coding to another person,
just like an architect designs a building and constructors build
it.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Courier New">My 2c, Jos</font></span></div><br>
<blockquote style="BORDER-LEFT:#0000ff 2px solid;PADDING-LEFT:5px;MARGIN-LEFT:5px;MARGIN-RIGHT:0px" dir="ltr">
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma"><b>From:</b> <a href="mailto:users-bounces@racket-lang.org" target="_blank">users-bounces@racket-lang.org</a>
[mailto:<a href="mailto:users-bounces@racket-lang.org" target="_blank">users-bounces@racket-lang.org</a>] <b>On Behalf Of </b>Harry
Spier<br><b>Sent:</b> martes, 19 de marzo de 2013 2:56<br><b>To:</b>
users<br><b>Subject:</b> [racket] OFFTOPIC - Quote on
Programming<br></font><br></div><div class="im">
<div></div>
<div>I found this quote on a blog and couldn't help sharing it :-)<br></div>
<div><br></div>
<div>"Debugging is twice as hard as writing the code in the first place.
Therefore if you write the code as cleverly as possible, you are by
definition not smart enough to debug it." Brian
Kernigan</div></div></blockquote></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>