I see that often someone makes negative examples and marks them either with //DON'T or similar. I think that is not enough; one should be able to visually tell positive from negative examples. For example, from this documentation
// valid
String[][] employeeGraph = new String[30][];
// invalid
int[][] unshapenMatrix = new int[][10];
Or from here:
//DO
for( int i = 0; i < numbers.length; i++ ) {
numbers[i] += 1; //or this: numbers[i] = numbers[i] + 1; or numbers[i]++;
}
//DON'T
for( int i = 0; i < 4; i++ ) {
numbers[i] += 1;
}
The proposition is that on the right side of the code block a red line is being displayed to mark the code block as a counterexample. Possible design and Markdown syntax:
<!-- bad-code -->
//DON'T
for( int i = 0; i < 4; i++ ) {
numbers[i] += 1;
}
displays as