Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Literate programming

Literate programming is a way of developing software where documentation comes first, then the coding. One writes the documentation of a code snippet, and then writes the implementation of the snippet. The visual appearance of the software source code would be a plain document like word, with code paragraphs in it.

I am trying to convert the dev shop I work to use only literate programming, as it brings great advantages to code readability and maintenance. However, due to the lack of tools the LP usage is limited in the company. For example, the ideal way to program literate is to write a paragraph using word markup, and then insert a subparagraph with the implementation. But i cannot seem to find any good tools for VS200x to perform LP with.

Ideally, such a tool would look just like Word 2007, but integrated into the IDE. When the coder sets the cursor on a code paragraph, it would have all the functionality provided just like we have now in our IDE.

What are good tools for LP, with .NET and VS200x in particular?

like image 850
user29688 Avatar asked Oct 20 '08 17:10

user29688


People also ask

What do we mean by literate programming?

Literate programming is an approach to programming in which the code is explained using natural language alongside the source code. This is distinct from related practices such as documentation or code comments; there, the code is primary, with commentary and explanation being secondary.

What is literate programming in R?

Literate programming is the practice of mixing code and descriptive writing in order to execute and explain a data analysis simultaneously in the same document. The targets package supports literate programming through tight integration with Quarto, R Markdown, and knitr .

Is Jupyter literate programming?

A form of literate programming, a Jupyter Notebook allows for the possibility of not only writing code but also inspecting and documenting its results as a piece of writing that is understandable for human beings.

Where do I write code?

Because most code is in plain text, you can write code using a basic word processor or text editor. However, it is much more effective to use a software application that is specifically designed for coding in a particular language.


2 Answers

Kudos to you for trying to improve the way your team works. As long as you're trying to do that, you have an advantage over those that do not.

I used Literate Programming for a project once. It was really hard, and the results were really good. Seemed like a reasonable tradeoff.

However, today I'd rather take a different approach: instead of prose for humans and code for machines, I'd rather write code that is so clear that humans don't mind reading it. When I feel the urge to write a comment, I think "I could make this code clearer". That means I'm writing less documentation, not more.

Well, good luck with whatever path you choose.

like image 61
Jay Bazuzi Avatar answered Nov 28 '22 08:11

Jay Bazuzi


+1 for trying to improve your team's process

-1 for going down a dead-end path

with all due respect to Knuth, unit tests are better than documentation

  • unit tests cannot become out of date
  • polluting the code with prose is a huge distraction when debugging
  • if your code really requires that much exposition, it is probably poorly designed and buggy
like image 42
Steven A. Lowe Avatar answered Nov 28 '22 08:11

Steven A. Lowe