News for hackers. Stuff that matters.
Re:The Word Count Problem by dinkumthinkum on Saturday July 28, 2012 @03:43AM (#4304995)
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.

Re:The Word Count Problem by powera on Saturday July 28, 2012 @03:50AM (#4305006)
Some 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".

Re:The Word Count Problem by zacharyvoase on Saturday July 28, 2012 @05:52AM (#4305184)
1) 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.

Re:The Word Count Problem by yk on Saturday July 28, 2012 @05:25AM (#4305141)
The 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).
Re:The Word Count Problem by pmiller2 on Saturday July 28, 2012 @04:32AM (#4305062)
Is 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

Re:The Word Count Problem by neopba on Saturday July 28, 2012 @10:31AM (#4305603)
> To me, "re-editable code" is much, much better than an untouchable black box or toolkit. (Knuth)

Probably Knuth misunderstood the concept

Re:The Word Count Problem by Evbn on Saturday July 28, 2012 @08:40PM (#4307071)
He didn't misunderstand the concept. He emphasized the needs for source access to libraries
Re:The Word Count Problem by neopba on Tuesday July 31, 2012 @04:27AM (#4316263)
Yes, that's true. However, code reuse is somehow opposed to source access to libraries, which should not be necessary true.
Re:The Word Count Problem by geon on Saturday July 28, 2012 @04:35AM (#4305071)
I 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.
Re:The Word Count Problem by ajanuary on Saturday July 28, 2012 @09:20AM (#4305452)
The same code in composable and reusable units would have demonstrated just as much.