User loginNavigation |
Executable 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? By Sean McDirmid at 2014-05-20 09:28 | LtU Forum | previous forum topic | next forum topic | other blogs | 5301 reads
|
Browse archives
Active forum topics
|
Recent comments
2 days 23 hours ago
2 days 23 hours ago
3 weeks 20 hours ago
7 weeks 5 days ago
7 weeks 5 days ago
8 weeks 1 day ago
8 weeks 1 day ago
10 weeks 6 days ago
11 weeks 4 days ago
11 weeks 5 days ago