15

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 doc

// 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 counter-example. Possible design and markdown syntax:

<!-- bad-code -->

    //DON'T
    for( int i = 0; i < 4; i++ ) {
        numbers[i] += 1;
    }

displays as

Displaying a bad code example

5
  • 1
    What is "not reproducible" in this problem? It is a feature request. We can talk about that it is useful or not (I think it is), but there is nothing about unreproducible problems here.
    – peterh
    May 31, 2018 at 20:41
  • 1
    It is also a clear request and does seek input from the community. Voting to Leave Open.
    – S.L. Barth
    May 31, 2018 at 20:53
  • 1
    "not reproducible" most likely refers to the [documentation] tag. Since that feature itself was phased out, a feature request for it is, in a way, not reproducible. I'm not sure how much the feature itself could be used in other QA on the site. May 31, 2018 at 23:08
  • 1
    I was one of the close flaggers. My intent was to close some of the old Documentation-related questions (so @WorldSEnder's assumption is correct). The given close reason was the best I could find (and I believe some other Documentation questions were closed for the same reason).
    – TuringTux
    Jun 4, 2018 at 5:24
  • It seems this feature request could also apply outside of Documentation, but it's probably less useful outside of it. Sep 9, 2021 at 12:54

0

Browse other questions tagged .