Re: Developing frameworks and applications in tandem and managing dependencies
John Elliot <[email protected]> Fri, 03 Aug 2012 01:27:58 +1000
| Newsgroups | gmane.comp.windows.off-topic |
|---|---|
| Message-ID | <[email protected]> |
On 2012-08-02 23:56, Alan Baljeu wrote: > There's a book titled Beautiful Code featuring famous programmers who write essays explaining what they found to be beautiful writing. One of them started with a short mathematical example and explained the limitations of that code. He went through about 20 revisions of the code each time expanding and complicating it to deal with the shortcomings. The end result is what he calls beautiful - a function from LAPACK or something like that. Efficient, robust, correct, parallelizable, portable. I have that book somewhere. I think it's in storage. I recall reading two of the essays and in each case being disgusted by the code. It was enough to put me off reading the rest of the book. I think people who go on about "beautiful code" are wankers. Code is always a mess. > It's not what I would call beautiful, but he has a point: correct code is not simple. It necessarily deals with the trouble cases, and those necessarily muddy the clear algorithms they embody. I remember hearing a comment from Donald Knuth wherein he was objecting to his colleague's view that mathematics and programming are the same thing. Knuth's argument was that programming always requires special-casing whereas mathematics can be elegant.