It seems that the quickest way to say “this code loops from 1 to 10” really is just
for(i=1;i<=10;i++){
…
}
If the high level description of the code accurately describes what the code does, then the high level description is just code.
But… the high level description might be shorter code!
For instance suppose prime(n) is a long piece of code using a variation on the Sieve of Eratosthenes. Then we could describe what this code does by giving a short program that finds primes by brute force. Each subroutine of the code has and “describing program” attached to it that does the same thing but is much simpler.
This sort of processing should not accurately describe the code. In order to do its job it should throw away tons of information—obliterating the difference between a for and a while loop, ignoring how most variables are handled, and at the highest level (both of description and of proficiency) just labeling the sieve of Erastosthenes as “a program that finds primes.”
Maybe it would be most human-friendly to imagine looking at code and “just knowing” what it does, the same way we “just know” that a splotch of color is a ball and how the ball is moving.
It seems that the quickest way to say “this code loops from 1 to 10” really is just
If the high level description of the code accurately describes what the code does, then the high level description is just code.
But… the high level description might be shorter code!
For instance suppose prime(n) is a long piece of code using a variation on the Sieve of Eratosthenes. Then we could describe what this code does by giving a short program that finds primes by brute force. Each subroutine of the code has and “describing program” attached to it that does the same thing but is much simpler.
This sort of processing should not accurately describe the code. In order to do its job it should throw away tons of information—obliterating the difference between a for and a while loop, ignoring how most variables are handled, and at the highest level (both of description and of proficiency) just labeling the sieve of Erastosthenes as “a program that finds primes.”
Maybe it would be most human-friendly to imagine looking at code and “just knowing” what it does, the same way we “just know” that a splotch of color is a ball and how the ball is moving.