33
you are viewing a single comment's thread
view the rest of the comments
[-] HaraldvonBlauzahn@feddit.org 21 points 12 hours ago* (last edited 12 hours ago)

This is a fantastic discussion between John Ousterhout and Robert Martin on the issue of commenting code, but more of understanding code.

In brief: Robert "Bob" Martin aka "Uncle Bob", author of "Clean Code", could not explain an algorithm he published himself in his own book. He generally advocates to minimize comments, and published it without comments.

When asked by Ousterhout, he was also not able to change it without breaking it, because he did not understand the invariants in the code he published.

Bonus points for that he copied the algorithm - which is an efficient algirithm for finding prime numbers - from Don Knuth, who published it as an example for his lucid invention of "Literate Programming" - a method to better explain code and its pre-conditions and invariants, by interspersing explanatory text with the actual code, and providing a tool that extracts the program code from it.

Extra bonus points for that the algorithm which Don Knuth documented was first published by grandmaster Edsger W. Dijkstra in "Notes on Structured Programming". A brilliant book chapter which explains once and for all invariants in code and data structures.

Both Don Knuth's article on “Literate Programming" and Dijkstras book chapter in "Notes in Structured Programming" are available online, I can only encourage to take the time to read them - both of them are timeless masterpieces on writing computer programs.

(And also, Ousterhouts book "A Philosophy of Software Design" is a really good and nice book on modern software engineering - highly recommended.)

this post was submitted on 08 Oct 2026
33 points (100.0% liked)

Programming

28739 readers
454 users here now

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



founded 3 years ago
MODERATORS