BYTE.com
RSS feed

Newsletter
Free E-mail Newsletter from BYTE.com
Email Address
First Name
Last Name




 
    
             
BYTE.com > Mr. Computer Language Person > 2006

The Art of Programming

By Martin Heller

May 29, 2006

(The Art of Programming :  Page 1 of 1 )



Like many programmers of my generation, I never took a formal course in Computer Science. By the time Computer Science departments were forming, I was a grad student in Physics, writing programs to analyze my data. To get to that point as a programmer, I taught myself from manuals and books and other people's programs, and wrote hundreds of programs; to help our research succeed, other physicists took the time to mentor me one-on-one and bring my programming up to the next level. Much later, I taught programming in a Computer Science curriculum, but that's another story.

Knuth

One of the most useful sets of books I bought as a 20-something physicist/programmer in the 1970s was Donald Knuth's The Art of Computer Programming (Addison-Wesley). I worked through all three volumes on my own. Along with the work of Niklaus Wirth and Edgar Dijkstra, Knuth's writing helped me learn about algorithms and data structures and structured programming.

In my first job, I often found myself going back to Knuth. For example, when an embedded program in a calibration instrument my group was developing was taking too long to report its results, I sat down with the junior programmer who had done the initial development and we reviewed the code. When we got to his sorting algorithm and I realized that he'd coded a bubble sort to order a very long list of numbers, I just about went through the roof. Knuth's comment that "the bubble sort seems to have nothing to recommend it" was fresh in my mind, as was its unsuitability for use with large lists.

We dragged out Volume 3 of The Art of Computer Programming, coded up several of the sorting algorithms, and ran benchmarks against sample data from the instrument. A variation of Knuth's Algorithm Q (quicksort) with a random break point for picking sub-files to avoid the famous worst case (the standard quicksort behaves badly when the list is already in order) turned out to be as good as we could do, and when we put it into the instrument the problems we'd been having disappeared.

 Page 1 of 1 


BYTE.com > Mr. Computer Language Person > 2006
Dr. Dobb's Media Center

What Zope Did Wrong (and How It's Being Fixed)
Dr. Dobb's talks with Lennart Regebro about the many things that Zope 2 did right and did wrong. Lennart has also been one of the driving forces behind Five, the integration of Zope 3 technologies into Zope 2.

Ubuntu and the Software Around It
Dr. Dobb's interviews Ubuntu's Gerry Carr about the Linux-based Ubuntu operating sytem and the application lifecycle tools -- such as the recently released Launchpad -- that surround it.

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE: Volume 2 - Heuristic Algorithms
The Best of BYTE: Volume 2 - Heuristic Algorithms
In this volume of Best of BYTE, we explore the emergence of some heuristic algorithms. Although we have only scratched the surface of this intriguing subject, we hope we've suggested the potential of the synthesis of heuristics and algorithms.

© 2008 Think Services, Privacy Policy, Terms of Service, United Business Media Limited
Site comments: webmaster@byte.com
Web Sites: BYTE.com, dotnetjunkies.com, Dr. Dobb's Journal, SD Expo, Sys Admin, sqljunkies.com, Unixreview



MarketPlace
simple helix is the most trusted name in the hosting industry! Join us and host with the experts!
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
HP network adapters help get the most from your virtualized servers. Learn more at HP.IntelVT.com.
Automatically capture customer crash data, no debugger required. Support for .NET, C++, OS X, Java.
Sign Up & Get Full Access To The Definitive Online Book Collection With SkillSoft's Books24x7�.
Wanna see your ad here?
 

web2