4 ms·
What works best for me is just write the code with no comments. Then, after I've forgotten how it works, go back and figure it out. Then I know just what the co
by WalterBright 5y ago
What works best for me is just write the code with no comments. Then, after I've forgotten how it works, go back and figure it out. Then I know just what the comments need to say!
A similar thing happens with error messages that compilers generate. The initial messages usually reflect what's going on in the compiler guts. It takes experience using the compiler to eventually figure out what it needs to say.
- js8 5y agoI do a similar thing in civil engineering. I build bridges with no safety factors, and when they collapse, I see exactly what safety factor was needed. That way, the effort of figuring it out in advance is never wasted. Edit: The above was (clearly) sarcasm. Although in real life, I do the similar thing with log messages - I always tend to find out what log messages I needed only after I debug a problem. I wouldn't frame it as a virtue, though.
- taeric 5y agoI mean... This isn't that far from how some civil engineering is done. The bridge you drive across is not the first pass at said bridge. And much of what makes safe structures today came from accidents years ago. I get what you intend. That we can also learn from the experience of others.
- WalterBright 5y agoMathematical models for bridge design rest on the rubble of extensive destructive testing and past collapsed bridges.