<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Reminds me of my answer to an interview
question:</FONT></DIV>
<DIV><FONT face=Arial size=2>which resource is most important in developing a
program?</FONT></DIV>
<DIV><FONT face=Arial size=2>Answer: that which is in shortest
supply.</FONT></DIV>
<DIV><FONT face=Arial size=2>Then it was memory and cycles, now it's skilled
manhours.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Tom</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:david.halliday@gmail.com" title=david.halliday@gmail.com>David
Halliday</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:kent@mailman.lug.org.uk" title=kent@mailman.lug.org.uk>Kent Linux
User Group - General Topics</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, December 01, 2010 2:23
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Klug-general] Obscure C at
saturday's meeting</DIV>
<DIV><BR></DIV>In many contemporary cases (I have seen some examples
otherwise) the cost of extra hardware to run a heavy application is lower than
the cost of a developer to optimise code.
<DIV><BR></DIV>
<DIV>Especially when optimising the code makes that
code harder to maintain or causes the next developer who looks at it
days lost in understanding what is going on. </DIV>
<DIV><BR></DIV>
<DIV>If optimisation across the board increases the man hours by one month and
then increases the time for a new developer to understand it then you have
covered some significant hardware upgrades (Lets face it a stick of
RAM costs less than one day of contractor time). </DIV>
<DIV><BR></DIV>
<DIV>TCO rears its interesting and confusing head.</DIV>
<DIV><BR></DIV>
<DIV>The obvious exceptions to this are things like hardware drivers and the
difference between highly optimised code and badly (sometimes this is semi
accidental) written inefficient code (Recently had an application
using very high amounts of memory because it was
loading thousands of large objects when it only needed to load an ID
and one other attribute).<BR><BR>
<DIV class=gmail_quote>On 1 December 2010 14:12, Mike Evans <SPAN
dir=ltr><<A
href="mailto:mike@tandem.f9.co.uk">mike@tandem.f9.co.uk</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex">
<DIV class=im>
<BLOCKQUOTE class=gmail_quote
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"><BR>OK
I understand that in the scheduler you want good performance
and<BR>compact code to get the most out of it, but some things were never
meant<BR>to be written.<BR><BR></BLOCKQUOTE></DIV>This may have been true
once - but hasn't been so for a long time. This is because an
optimising compiler will produce the same or better machine code from simply
written, well structured and legible program code.<BR><BR>I remember (about
18 years ago) in a quick panic wanting to slow something down and just
added:<BR><BR>for (i=0, i<1000, i++) /* do nothing */;<BR><BR>Yes - I
know I should have used sleep(), but never mind. This didn't make the
code slow enough, so I changed it to:<BR><BR>for (i=0, i<1000000, i++) /*
do nothing */;<BR><BR>and it didn't take any longer. When I stopped
the compiler at the assembly stage and looked at the machine code what the
compiler had actually done was the equivalent
of:<BR><BR>i=1000000;<BR><BR>Served me right really. Valuable lesson
though: write the code as clearly as possible and let the compiler optimise.
It will probably do a better job than me, and will introduce fewer
bugs in the process.
<DIV>
<DIV></DIV>
<DIV
class=h5><BR><BR><BR>_______________________________________________<BR>Kent
mailing list<BR><A href="mailto:Kent@mailman.lug.org.uk"
target=_blank>Kent@mailman.lug.org.uk</A><BR><A
href="https://mailman.lug.org.uk/mailman/listinfo/kent"
target=_blank>https://mailman.lug.org.uk/mailman/listinfo/kent</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Kent mailing
list<BR>Kent@mailman.lug.org.uk<BR>https://mailman.lug.org.uk/mailman/listinfo/kent</BLOCKQUOTE></BODY></HTML>