News for hackers. Stuff that matters.
Re:Writing system software: code comments by therealdrag0 on Monday October 08, 2018 @01:01AM (#18164240)
I really appreciated this taxonomy! It lines up with my own experience; but I've never thought about it this thoroughly.

One specific type of comment that I've found valuable is a sort of BDD in my tests.

  testMethod() {
    // GIVEN a <specific type of thing>
    <setup code>
    
    // WHEN the <specific operation is done>
    <do the thing code>
    
    // EXPECT <specific effect>
    <assertion code for the effect>
  }
These are like "guide comments" but with more structure. I find that they help write tests and also make reading tests transparent.

There are no comments on this comment yet.