You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
6Literate programming, as well as comments in general, is not about what your code is doing. You can read that from the code itself. It is all about why and how, and this essential information is almost always missing without a proper literate programming. Needless to mention that the "why?" part quite often would involve elaborate and complicated mathematics, sometimes plots and tables, sometimes diagrams. Literate programming tools are necessary to maintain such comments in a readable way.SK-logic– SK-logic2012-02-28 07:59:18 +00:00Commented Feb 28, 2012 at 7:59
-
1@SK-logic fair, but the point that David Thornley is making is that even the WHY can turn out to be a misleading lie (one that is actually even harder to comprehend).MrFox– MrFox2012-10-11 16:57:07 +00:00Commented Oct 11, 2012 at 16:57
-
1+1 Knuth was writing back in the (thematic) wild west days of programming when working in an "advanced" language meant writing "C" almost on top of the metal instead using machine code. Memory was so tight variables and other names were usually just single letters, often reused from scope to scope. The vast majority of programs where turn-key one shots written and maintained by one person each with his own eccentric style. Having to take over a code base was more decrypting than reading. There was no source control etc to help out.TechZen– TechZen2016-06-30 02:13:54 +00:00Commented Jun 30, 2016 at 2:13
-
1Knuth was looking down the road, 30 years ago today. He knew programs would get bigger, more complicated, be written by teams with shifting members, would run for years or decades and require input, assessment and eventually acceptance from non-programmers. Literate programming was an idea for addressing all that. He was roughing out what we today call business logic and BDD. The core idea being that programmers would know what to do and non-programmers could follow along. As noted, the idea failed because no mechanism exist to enforce the linkage between the "literate" text and the code.TechZen– TechZen2016-06-30 02:18:22 +00:00Commented Jun 30, 2016 at 2:18
-
BTW: This is why I like "self-documenting" languages like Objective-C. At first the code looks way to cluttered with absurdly long method names, but even a programmer who doesn't know the language or the API can quickly puzzle out what the code is doing. Best of all, change the code and the "comments" change in sync automatically. Of course, that's why Objective-C was written with autocomplete built in. Without it, writing Objective-C is pretty hellish.TechZen– TechZen2016-06-30 02:23:30 +00:00Commented Jun 30, 2016 at 2:23
|
Show 1 more comment
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you