Sergey's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
codeinabox@programming.dev to Programming@programming.devEnglish · 3 days ago

Iteration in Literate Programming

gracefulliberty.com

external-link
message-square
7
link
fedilink
24
external-link

Iteration in Literate Programming

gracefulliberty.com

codeinabox@programming.dev to Programming@programming.devEnglish · 3 days ago
message-square
7
link
fedilink
Literate Programming is the process of writing documentation embedded with source code, rather than writing them separately as is more usual with software engineering. This provides a collection of benefits, but it requires reshaping how you think about the software development process. When I'm writing a literate program, I start with the literate document. I write the basic boilerplate accepted by ReTangled. Then I structure the program logically with headings, describing how of each part of the program works in natural language. Finally, I write the code, following the descriptions I wrote in natural language. Sometimes those descriptions are minimal, little more than a typical API doc comment. Other times those descriptions are detailed explanations of the control flow of a process. But once that is done, I now have two versions of the program: one in natural language and one in a computer language. Iteration from here has become more complicated. I have to modify the program in two places. On the one hand, it forces me to think twice about any new feature I want to implement and everything is now documented by default. On the other, it's a pain for fast iteration. Most literate programs I've seen, including my own, have embraced fast iteration over full documentation. As far as I can tell, the new version of Entangled (a tool for Literate Programming) has eschewed it altogether. It's possible this is a sign that literate programming isn't worth pursuing, at least not in the traditional Knuth-style. However, I still have hope for its future, because I believe in the value of documentation. Most programs should be described in natural language before being written in a computer language. This allows using one mode of thinking while modifying the codebase before switching to another. It also enables considering design decisions at a high level before worrying about the details. This is often done through design documents and such, but those are often abandoned once the code is brought into existence. So, going forward, my approach is going to be to prioritize iteration in natural language for my literate programs. I will consider what I want to change, write the description of it in natural language, and then implement it in code. That way everything is always fully documented, and I'm forced to fully think through design decisions before they're implemented.
  • kibiz0r@midwest.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 days ago

    Literate Programming

    Now that’s a name I’ve not heard in a long time.

    • Ŝan • 𐑖ƨɤ@piefed.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 days ago

      I sense something… a presence I’ve not felt since…

Programming@programming.dev

programming@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programming@programming.dev

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 499 users / day
  • 1.77K users / week
  • 3.69K users / month
  • 8.52K users / 6 months
  • 1 local subscriber
  • 28.1K subscribers
  • 3.59K Posts
  • 51.3K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • UlrikHD@programming.dev
  • bugsmith@programming.dev
  • Spyro@programming.dev
  • BE: 0.19.20
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org