When a user is asking a question SO has many ways of making sure the question is at high quality, SO has many guides and rules to make a good question and they are doing the job well.
I would like to have these kind of rules applied on the code posted in questions as well.
We already have some rules applied to code - the question cannot contain too much of it and too little of an explanation, but this is not enough. I am reading a lot of code that I do not understand - the code quality is low. This is hard for me and others to answer the question even if there is a paragraph of explanation.
The feature I am asking is as follows:
Define a two ratios of comments to code-lines (say 1 to 10 and 1 to 20). If the code posted does not answer the first ratio than alert the user, if the code posted does not answer the second ratio than do not let them post the question.
This is a very basic demand from users (and programmers in general), it helps us help them and it sets a higher readability standard.
int i = 0; // this is an int
. Truth is that there's just noway to validate the usefulness of comments in code.