Here is an example of link only answer: https://stackoverflow.com/review/low-quality-posts/12607586 It uses Gist to answer instead of quoting the code directly, but trying to inline Gist code, makes the post too large. What should one do, when reviewing such question?
-
7If the question requires a whole application to answer, close as too broad. If not then the answer should be something that minimally answers the question and not somewhere in some multi-file answer on a separate site.– Robert LongsonJun 7, 2016 at 14:24
-
1@Robert Longson : I think his answer is potentially correct, but he linked to a class that has 2000 lines of code. As far as I recall making your own custom character folder is somewhat expected for non-English languages. It's like extending functionality of existing class for your specific case. Only ASCIIFolding.java file is of interest for the answer.– Daniel FathJun 7, 2016 at 14:26
-
To clarify, putting content of ASCIIFolding.java file into the answer is impossible, and that would be the ideal solution.– Daniel FathJun 7, 2016 at 14:39
-
In that case the question is likely too broad.– Robert LongsonJun 7, 2016 at 14:41
-
1So either the relevant snippet is small, and can be included, of it isn't, and the question should be closed.– ServyJun 7, 2016 at 14:43
2 Answers
Such an answer does not meet the quality standards of Stack Overflow.
During review:
First review the question - vote to close as too broad if appropriate. Consider adding a comment to the answer about "link only" if not there yet.
Pick one or more options for the answer:
- Delete the answer, possibly manually converting to a comment on the question (or other relevant answer)
- Edit in important part of code if you are really confident in what you are doing. Avoid it unless there are no comparable answers already.
- Add a wiki answer and inline important code with attribution
Most of the length there comes from the case statement. I would omit most of it like this:
public class ASCIIFolding {
@NonNull
public static String foldToASCII(@NonNull String input) {
return foldToASCII(input, new StringBuilder(input.length()));
}
@NonNull
public static String foldToASCII(@NonNull String input, @NonNull StringBuilder sb) {
final int end = input.length();
for (int pos = 0; pos < end; ++pos) {
final char c = input.charAt(pos);
// Quick test: if it's not in range then just keep current character
if (c < '\u0080') {
sb.append(c);
} else {
switch (c) {
case '\u00C0': // À [LATIN CAPITAL LETTER A WITH GRAVE]
/* Omitted other cases for brevity, see Gist for complete code */
default:
sb.append(c);
break;
}
}
}
return sb.toString();
}
It's not as hopeless as everyone's making it out!
-
1I like this but the link to full code needs to be somewhere that is not going to go away. The switch statement is the main part of the code and if we lose that the answer becomes incomplete. Jun 7, 2016 at 15:33
-
@NathanOliver I was imagining this as an addition to the answer. It wouldn't make sense to suggest people check the Gist, but not give a link, after all.– LaurelJun 7, 2016 at 15:38
-
1I get that but we don't want the link to rot is my point. Not sure if it will with github or not but that needs to be taken into concern as answers should be complete and links only used as reference, may want to see. Jun 7, 2016 at 15:41
-
1This, plus/or a couple of sentences of prose explaining the omitted pieces would go a long way.– jscsJun 7, 2016 at 19:07