That is a great question. And there's probably no one<br>
correct answer. My answer would be working code,<br>
since optimized code that doesn't work and correct<br>
code that doesn't work has less business value than<br>
working code.<br><span class="sg">
<br>
JD</span><div><span class="e" id="q_108f8a47218fc010_2"><br><br><div><span class="gmail_quote">On 1/23/06, <b class="gmail_sendername">Randy Rue</b> <<a href="mailto:rrue@fhcrc.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rrue@fhcrc.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Great question, and of course the short answer is "It depends."<br><br>Years before I ever heard the project management term "triple<br>constraint" a contractor friend of mine (contractor like hammer and
<br>nails and a white pickup truck, not like dev-for-hire) asked me if I<br>wanted the job done "fast, cheap, or right, pick any two." I've never<br>heard the concept explained better since.<br><br>So the answer to "which comes first" depends on the situation and the
<br>priorities of the consumer. Is this app a heavy resource user? Tune it.<br>Is it expected to be in use for a long time and maintained by baboons?<br>Make it correct, avoid cryptic shortcuts, and comment the bejeezus out
<br>of it. Are we all fired if it's not running by noon? Fix it now!<br><br>Assuming no constraints? Make it correct, even if it means getting not<br>it working as quickly. Get it working. Then see about tuning it.<br><br>
My unsolicited $0.02.<br><br>Randy Rue<br><br><br><br>Fred Morris wrote:<br> > The interview question I haven't been asked lately...<br>><br>> Which comes first:<br>><br>> * optimization<br>> * correctness
<br>> * working code<br>><br>><br>> At 11:04 PM 1/21/06, Creede Lambard wrote:<br>><br>>>Come up with a good way to reverse a string. I get asked that about two out<br>>>of three interviews, it seems like. Oh, and no one seems to like
<br>>><br>>> print join ('', reverse( split (//, $string)));<br>>><br>>>which seems unfair to me. I mean, if they're going to expect me to use Perl,<br>>>I should be able to use Perl, not use Perl in a particular way they mandate
<br>>>(they seem to always want something that uses substr). [...]<br>><br>><br>> --<br>><br>> Fred Morris<br>><br>><br>> _____________________________________________________________<br>> Seattle Perl Users Group Mailing List
<br>> POST TO: <a href="mailto:spug-list@pm.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">spug-list@pm.org</a><br>> SUBSCRIPTION: <a href="http://mail.pm.org/mailman/listinfo/spug-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.pm.org/mailman/listinfo/spug-list</a><br>> MEETINGS: 3rd Tuesdays
<br>> WEB PAGE: <a href="http://seattleperl.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://seattleperl.org/</a><br>_____________________________________________________________
<br>Seattle Perl Users Group Mailing List<br> POST TO: <a href="mailto:spug-list@pm.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
spug-list@pm.org</a><br>SUBSCRIPTION: <a href="http://mail.pm.org/mailman/listinfo/spug-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.pm.org/mailman/listinfo/spug-list</a><br> MEETINGS: 3rd Tuesdays
<br> WEB PAGE: <a href="http://seattleperl.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://seattleperl.org/</a><br></blockquote></div><br>
</span></div>