4 ms·
I want to be charitable but I find the criticism here of Knuth of be quite childish. Was the point to solve the problem with as little work as possible? If that
by dinkumthinkum 14y ago
I want to be charitable but I find the criticism here of Knuth of be quite childish. Was the point to solve the problem with as little work as possible? If that's the case, there's probably some plugin for your favorite text editor that already does this. So what? What was the point exactly? You could just have easily built a library function that does all of this and then write a Pascal program that calls the library in one line of code, state the library is not part of your solution, and say the solution is better than the one with UNIX utilities. So what? Is the point to illustrate that Knuth is unaware of elementary concepts such as code reuse, come on that is just sort of ridiculous.
If you had asked Knuth to solve this problem using any means in the whole world and do it within 10 minutes, I don't think he would have any trouble doing it.
And honestly, if the lesson is to teach us some really basic lesson of code reuse, not reinventing the wheel, or some such like that, I think this was a pretty convoluted way to deliver sort of a common sense lesson.
- yk 14y agoThe point, imho, is to illustrate literate programming, a technique designed to write easily understandable code. And the rebuttal is, that with high level tools and a good documentation you can build as easily understandable code in about 20 lines including comments. (To be fair, one would need to understand all the tools used for comparison to Knuths program).
- powera 14y agoSome other points from the linked-to article that back up that the criticism here is a bit ridiculous: 1) This was in 1986. That's about 4 lifetimes ago in computer programming. 2) This was an article specifically to demonstrate literate programming. It wasn't supposed to be "the most efficient way" possible. It's approximately the same argument as "why should I write a program to sort data in an interview; I'm not going to get paid to write sorting functions".
- zacharyvoase 14y ago1) I'd like to see you say the same about differential calculus, which actually was several lifetimes ago. 2) I have made the same argument, in interviews, many times. It's a good argument to make.
- pmiller2 14y agoIs the point to illustrate that Knuth is unaware of elementary concepts such as code reuse.... In fact, Knuth considers reusable code to be a "menace." http://www.informit.com/articles/article.aspx?p=1193856 http://www.informit.com/articles/article.aspx?p=1193856
- neopba 14y ago> To me, "re-editable code" is much, much better than an untouchable black box or toolkit. (Knuth) Probably Knuth misunderstood the concept
- geon 14y agoI would argue that more code is a better solution in this case. The purpose was not to write short, clear code, but to illustrate a certain programming style. How am I supposed to "get" the style in 5 lines? A short solution would have been a failure.
- ajanuary 14y agoThe same code in composable and reusable units would have demonstrated just as much.