User loginNavigation |
archivesExecutable commentsSo this idea just sort of crystallized in my head: what if rather than documenting code does in comments, we instead added a bunch of printfs to the code so, when necessary, the code can explain what its doing while doing it. Of course, this doesn't seem so new and novel, but what I'm suggesting is that comment syntax be replaced by printf syntax in a language design. Then, we somehow must provide a way to "turn it on/off" so that when it is off, it has zero cost, and we can selectively turn it on during debugging when we need code to explain themselves. This should apply to library documentation also, so that methods can explain what they are doing when stepping through code (as Bret Victor demonstrates in his learnable programming essay), while the print statements should clean enough that they can also act as static documentation when necessary. What do you all think? |
Browse archivesActive forum topics |
Recent comments
35 weeks 6 days ago
35 weeks 6 days ago
35 weeks 6 days ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 14 weeks ago
1 year 19 weeks ago
1 year 19 weeks ago