3 ms·
I think you're misunderstanding what happened, there are three people in the story. Bentley asked Knuth to write a literate program to solve the problem. He t
by jewel 11y ago
I think you're misunderstanding what happened, there are three people in the story. Bentley asked Knuth to write a literate program to solve the problem. He then asked McIlroy to critique the solution. McIlroy was the one that provided the shell script code.
It's impossible to know if Bentley intentionally picked the problem that would be easy to solve in shell script, but I don't think it's likely.
A lot of text processing problems are solved really well by the standard set of unix tools, I write similar scripts probably about once a month to extract counts out of log files.
- fenomas 11y agoOops, you're right - I joined them into one person. With that said, I didn't really mean to suggest the exercise was set up to snipe at Knuth, just that the criticism (McIlroy's) seems off the mark. I mean, one presumes that when Knuth wants to count the words in a text file he uses shell scripts, right? It would follow that he's only applying Literate Programming to a toy problem for purposes of illustration. As such, saying he's wrong to use LP for this task seems to miss the point (and doesn't say much about LP).
- KC8ZKF 11y agoI agree with you as long as we are talking about this blog post and not about Knuth's article or McIlroy's critique, which I don't have access to. Knuth republished both, so they must have some things to say about Literate Programming.