Why I run away from KnuthMay 8, 2008 at 5:54 pm | Posted in History, Programming | 18 Comments
Tags: books, Programming, software
someone named Greg commented on this post, very politely, that I am wrong in saying that Maths is not necessary. you can see his full comment in the comments after the post but I have quoted things here and have edited my original post to present a more fundamental answer to his questions.
Donald Knuth . Nearly every programmer, at some point of his life has got hit by this name or truly I should say got intimidated by his way of presenting algorithms. Many programmers think that he has wrongly titled his book as “The Art of Computer Programming”, though I don’t agree with them. Most programmers get scared when they look at his book. Heck, when, in 2002, I saw his book for 1st time, I thought, they were Mathematics books. Its only later when I started to do programming, in 2005 or 2006, I found out they were basically about algorithms. Still, I don’t read Knuth for some personal reasons which are totally different than what other programmers will state. These are all my personal thoughts about his style, I am not saying what Knuth is, all I am saying is what I feel about his writings and hence you can call it a biased opinion:
He is Quite academic. His books feel like they are written in a formal way, for schools or for MCAs, Post-Grads or Ph. D students. If you read these 4 books:
1.) How to Design Programs (HtDP)
3.) Practical Common Lisp
4.) Introduction to Algorithms
then you will come to know what I am talking about. All of these books have quite very different styles of presenting their concepts and the way they approach the problems are totally unrelated. As per my opinion, if you like K&R2, you will like Practical Common Lisp and if you like HtDP, you will never like K&R2 and Practical Common Lisp but you may like Introduction to Algorithms. HtDP is an academic book, written for students, I bought it from USA, for 6000 rupees and fro that time repenting why the heck I did the mistake. “The Little Schemer” has the same academic style. I am a real-life programmer, writing programs for some company and getting paid at the end of every month + 7 days 😉 . I get frustrated at this academic style and by the same analogy, I also get frustrated when I see books I read in my Graduation, they were totally not related to what I am doing right now as a programmer in some company. Though they were programming books but they were not written to show you the reality of what happens when you use scp to copy file over a network. How that scp program looks like and Why it is so strange at 1st. Those books will never tell you ( in code ) that their could be errors, their could be failures, their could be some problem in making a connection, that, for obvious reasons, you have to use ” -ansi -pedantic -Wall -Wextra” while working with GCC but all we learned were TURBO C and a book on DOS 6.2 ( this shitty-book had cost me my precious 600 rupees )I put Knuth in the same category. He just explains, explains and explains the algorithms, with 100% Mathematics, in the most detailed manner ever done and leaves the applications of those algorithms up to you. They are not designed for people like me. 
If you don’t know then I want to tell you that Donald Knuth is a child-prodigy. When he was in 7th grade, he was solving mathematical problems of his seniors in higher-grades . I am not a child-prodigy, I am an average man, with an average IQ. I could have have failed the Mathematics exam of 10th class in 1996. I was very poor at Mathematics and I was expecting only 22 or 34 marks out of 100 and anything less than 33 means you have failed the exam but I purchased 2 very heavy-books of Mathematics, which our teacher called best references books for 10th class and studied them at the cost of my health for 2 months and then I got 83 marks 🙂 but those health problems, the pain in the neck are still with me after 12 years 😦 ) . Since I was weak in Mathematics may be thats why I don’t like Knuth’s style 😉 . Knuth explains algorithms from one angle while not from the other. He explains everything, very diligently, in a detailed manner, from his angle, from his viewpoint (which is Mathematical and Mathematics is what he is good at) and he totally ignores the other viewpoints. On comp.programing, someone said this:
If you want to know how to take simple things and make them as as obtuse as humanly as possible, read Knuth.
A pity. Knuth is clearly the best computer science author ever, period, no question about it. But also quite academic in his approach.
On the other hand:
American Heritage Dictionary : academic (ak’?-dem’ik) adj.
1. Of, relating to, or characteristic of a school, especially one of higher learning.
A. Relating to studies that are liberal or classical rather than technical or vocational.
B. Relating to scholarly performance: a student’s academic average.
3. Of or belonging to a scholarly organization.
4. Scholarly to the point of being unaware of the outside world. See Synonyms at pedantic.
5. Based on formal education.
6. Formalistic or conventional.
7. Theoretical or speculative without a practical purpose or intention. See Synonyms at theoretical.
8. Having no practical purpose or use.
If you are speaking of the 4th, 7th or 8th form, then I quite agree with you.
Knuth uses Mathematics to present his ideas while those very ideas can be presented without much Mathematics. As per my experience, Programming is a totally different phenomenon, its about analyzing problems, finding solutions and recognizing the patterns before you even start to code, as a daily-coder, recognizing the design of the solution and structure of the whole basic idea that will write in your favorite programming language. And this explanation has nothing to do with Mathematics. Hence one can explain the algorithms in as detailed manner as of Knuth from another viewpoint, like recognizing to what pattern problem belongs. Do not confuse the word Pattern with Design-Patterns of OOD, patterns mean simple way to generalize a problem and finding the category to where it belongs or create a new category of patters by using your experience with analyzing problems and then you can use whatever interface you have to show that design/solution/connection on paper. That could be a diagram, or a formula represented using ( x, y or + etc., which is Mathematics) or you could use something else I am not aware of. Then you will be a creator 🙂
I think understanding K&R2 is as much hard as understanding Knuth ( I did not say reading, I said understanding) , thats what I have felt and I have enjoyed the painful and difficult K&R2 while I contribute all of my frustrated moments to Knuth. Don’t ever think that K&R2 is easy, it is a small book, at a very cheap price and it will extract the brains out of you. You are warned.
> Mathematical analysis of algorithms is of
> fundamental importance; however, it is not
> for everyone. The fact that you can compile
> your source codes very fast, the fact that
> you can search a string within a text very
> fast, it all comes down to the mathematical
> analysis of algorithms.
What is the point of using Mathematics to represent algorithms ?
Mathematics is a traditional and quite good tool to represent some underlying concepts and fundamentals in formal way. Maths is a formal way of representing something more abstract than Maths:
Underlying Fundamental Concepts & Ideas | | | Formal Representation of those ideas using Maths. | | | Algorithms & Data Structures
what I am saying is the understanding underlying fundamental ideas which are more abstract and basic than Maths is more important than Maths. Mathematical is used as a tool in computer programming to represent some ideas and I think anyone will be in better position if he tries to understand those ideas first but people put whole of their emphasis on Maths which is not the way to do programming. Take one more example:
N - 1 ------------ \ \ \ / / / ------------- i = 0
that is sigma, a mathematical notation to represent that “i” goes from zero to N. Now look at this:
for( int i = 0; i != N; ++i );
this does the same thing, a for loop. That sigma, the Mathematical notation, is a for loop in disguise but nearly all of the books that teach algorithms use sigma instead of for loop. The Sigma belongs to Mathematics and for loop belongs to programming but the main underlying idea is to start i at zero and then increment it till it is less than N. Sigma is used to formally represent that concept. you can’t use sigma inside C++ code, you can use only for loop 😉
> Sometimes, we take for granted what went
> into creating the high-level stuff that
> we enjoy so much. Find it out yourself:
> imagine a compiler without automata theory.
again, automata theory is modal to represent more abstract and more important concepts.
> Mathematical analysis of algorithms is of
> fundamental importance; however, it is not
> for everyone.
yes, it is not for people like me, who like to invest their time into practical ways of understanding programming and much more interested in representation of those ideas into code, rather than pondering on learning formal ways to express those ideas.
But I will still say, as of 2008, I think Maths is the best tool to represent ideas formally, I don’t think any other tool will fit better. First one needs to understand those underlying ideas and concepts that Mathematics represents and then one needs to understands Maths, if he is interested in representing those ideas formally, I don’t. I represent them directly using code. May be, in future, I create some tool to represent basic ideas informally 🙂
 Don’t think that Knuth is only theoretical, some time ago, he wrote a very specialized algorithm for a quite powerful chess program)
 Discrete Mathematics and Its Applications by Kenneth H. Rosen, The author gives brief histories of most mathematicians in his book.
Copyright © 2008, Arnuld Uttre, #331/type-2/sector-1, Naya Nangal, Distt. – Ropar, Punjab (INDIA) – 140126
Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.