go to previous page   go to home page  

Answer:

Rarely. Clean logic usually runs faster. Twisted logic is hard to compile, so a compiler might output inefficient machine language.


Last Page

Programs should be written so that the logic is clear and so that the code can easily be debugged and maintained. Don't break the structure for some small hope for speed .

Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.
--Donald Knuth

Those programmers that are 10x more productive than others know where to spend their time.


You have reached the end of the chapter. Hopefully, it was time well spent.

go to previous page   go to home page