76

I came upon a question just now where the OP's code has serious errors which leads to problems, and the OP asks how to solve the problems. So far, so good, but after having the serious errors pointed out to them, they refuse to correct those, they only want a solution for the resulting problems!

How to proceed in a case like this? How to not break the "be nice" rule while trying to explain that their question doesn't fit the SO quality standards, and will probably be deleted? (In many cases, the OP doesn't mind about the quality standards, so that's not even a good reason in their eyes not to provide them the quick fix.)
Also, if they don't listen at all, which close reason to use? "The code is crap and is not salvageable" is not among the close reasons.


Note: the last sentence above was an afterthought, and it is addressed in questions like Reviewing some awful questions is just a waste of time, can we have a “no comment” close reason for these?, but that is not the main focus of my question.

41
  • 29
    I'd downvote and close perhaps as "unclear what you're asking"? And possibly add a comment along the lines of "I'm sorry, but the problems result from the serious problems in your code pointed out above. If you're not going to fix those, there's nothing we can do to help."
    – Pekka
    Commented May 12, 2018 at 13:19
  • 36
    I lean towards Too Broad since explaining things to OP in such cases would probably need a full fledged tutorial or the singe question may have multiple issues needing multiple questions.
    – Suraj Rao
    Commented May 12, 2018 at 13:22
  • 31
    Don't say anything. If there are many serious problems throughout the code, then the question is too broad, we should vote to close it as too broad, and move on. Comments made to help improve the question won't likely help in this situation. Commented May 12, 2018 at 13:24
  • 6
    Hey @MrLister see how Mr Nice Guy answered all my demands. Was that so hard for you to do?
    – rene
    Commented May 12, 2018 at 13:30
  • 4
    Helpful for the community and future visitors is probably a close vote, too broad will work or a custom reason: I'm closing this question because it has too many unrelated issues to the core problem and answers would be confusing if they address the core problem but not the other issues or vice versa.
    – rene
    Commented May 12, 2018 at 13:34
  • 2
    @duplode it is fearful, yes. I assumed the eggshells could carry this weight ...
    – rene
    Commented May 12, 2018 at 13:50
  • 1
    @rene I just mean I don't think we should preemptively delete our own constructive comments aimed at driving improvements to a post.
    – duplode
    Commented May 12, 2018 at 14:00
  • 6
    @duplode the problem is that we usually do a bad job at judging how constructive our own comments are. If the receiving party doesn't seem to find them constructive, they obviously aren't and doesn't become better by keep hitting the user with extra comments how constructive, welcoming and helpful your comments are. They have already been dismissed, you've lost the rally. You're hardly ever going to gain trust in that conversation again. The persistent idea of the old bunch here that they are leaving constructive comments, is the problem. Stop doing that. That is nice.
    – rene
    Commented May 12, 2018 at 14:16
  • 7
    Be nice - so what, OP has not got an answer from you. Be not nice, so what, OP has not got an answer from you. Be welcoming, so what, OP has not got an answer from you. Be really snarky and rude, so what, OP has not got an answer from you. Whatever you do, so what, OP has not got an answer from you. So, just go with the minimum effort on your part - down/close/delete vote. Commenting is often just a waste of typing that identifies an abuse/retaliation target:( Commented May 12, 2018 at 14:51
  • 5
    @duplode sure, and what are you going to do about that OP being wrong? Send electric shocks through their keyboard? I mean this XKCD is not joke. That is us.
    – rene
    Commented May 12, 2018 at 15:33
  • 3
  • 21
    Just walk away. You've offered help, it's been declined, don't waste any more time on this person. Let them dig themselves deeper into their hole. (More seriously, think about your motivation. Why do you feel compelled to make them listen to you? Yes, we all hate it that there are incompetent people in our profession giving the whole industry a bad name. But you're not going to solve that single-handedly) Commented May 13, 2018 at 8:40
  • 3
    Do not try to sell fixing the code as "quality standards". Tell them "fixing X will help you solve Y, that 's why I recommended it". Also, there's crap and there's crap: something that betrays a fundamental lack of understanding, vs legitimately shortcutting that a busy person might do. It's hard to triage.
    – smci
    Commented May 13, 2018 at 9:28
  • 2
    You have to remember to focus on the problem expressed by the OP. If I take my car to the mechanic because I have an oil filter problem the last thing I need my mechanic to say to me is go paint your car and them bring it back that color is aweful. I know that I don't always write great code when I'm just trying things out.
    – dannyhut
    Commented May 14, 2018 at 5:39
  • 2
    My argument is we shouldn't assume we have a handle on what constitutes well written code. Programming is about managing complexity, if the code does that then how its achieved should not be an issue.
    – dannyhut
    Commented May 14, 2018 at 8:02

6 Answers 6

87

The idea you're trying to communicate is inherently not nice. So don't bother trying to communicate it.

Downvote, close vote if it's appropriate (if a post has lots of disparate bugs, then it's Too Broad), and move on.

29
  • 21
    I agree for the most part, but I think "don't bother being nice" somewhat implies that it's OK to be not nice, and I don't think that's the case. There's nothing inherently "not nice" about constructive criticism, and you can deliver it in a manner that isn't sarcastic or belittling, which is the part that a small part of this community sometimes misses.
    – user229044 Mod
    Commented May 12, 2018 at 14:28
  • 16
    @meagar no, it actually implies "if you can't be nice, just SYA and don't say anything".
    – Braiam
    Commented May 12, 2018 at 14:40
  • 2
    @Braiam I realize that's what people should infer from it, but it's easy to take it the wrong way.
    – user229044 Mod
    Commented May 12, 2018 at 14:56
  • 62
    @meagar: ""don't bother being nice"" That's not what I said. I said don't bother "trying to communicate" things that are "inherently not nice". Commented May 12, 2018 at 14:56
  • 4
    To me, this is an example of where we (I) have issues with the now infamous blog and being nice in general. Because voting and moving on doesn't produce the desired results for SO and voting without specified reasons now falls into the not-so-nice category, we (I) have an obligation to at least create data that can be used to determine our effective niceness. We can do that by providing examples of what we (I) see as the "real" problem. Commented May 12, 2018 at 20:28
  • 12
    @meagar And your attitude creates the one of this answer: do nothing to help the person. How is that nicer? This "be more welcoming" nonsense has users afraid to actually criticize anything, even constructively. That is not healthy for the community. We're not here to make people feel good about themselves. We're here to help them be better programmers; they can feel good when they become better programmers.
    – jpmc26
    Commented May 13, 2018 at 13:34
  • 4
    Reminds me of dating and how ghosting is deemed to be accepted practice, but on the other end, you're just left hanging. Wouldn't it be better to tell the guy/girl the code is crap? I get seriously annoyed with the anonymous downvote with no feedback. It's BS. We should have the courage to give the feedback, and not worry about being mean. Feedback will help them improve. A downvote will not. I was going to simply downvote your answer, but wrote this as well.
    – gdbj
    Commented May 13, 2018 at 15:17
  • 1
    @jpmc26 "do nothing to help the person" -- Cf. my comment just above, and also note that the Meta OP had already pointed out the mistake in the code, so that probably shouldn't be the primary focus of this discussion.
    – duplode
    Commented May 13, 2018 at 15:37
  • 3
    @jpmc26 (1) Presentation matters. (2) "Your code does XYZ, which is a serious mistake" is an objective, likely actionable assessment that the asker and other readers can build upon. "Your code is crap" is a value judgement that, in comparison, adds very little to the discussion. So there are relevant differences.
    – duplode
    Commented May 13, 2018 at 19:59
  • 1
    @duplode Obviously there are differences. Nonetheless, this "be welcoming" mess is having the exact opposite effect: a chilling one. Because this answer is right: telling someone they did not do a good job is fundamentally never going to be pleasant. It is always going to pose the risk of offending the reader.
    – jpmc26
    Commented May 13, 2018 at 23:52
  • 2
    @jpmc26 Of course the risk is always going to be there. The question always was, and still is, how much risk we should accept -- too little, and no criticism is possible; too much, and criticism becomes counterproductive. It is not an all-or-nothing situation. Those who frame it as such are making a questionable risk assessment, which achieves little more than radicalising the debate and entrenching fears.
    – duplode
    Commented May 14, 2018 at 2:34
  • 3
    @jpmc26: "Keeping a neutral attitude isn't good enough now. It's considered rude to point out that the line of code that appears in an error message is missing from the post!" I do not recall any statement about site policies regarding this. I suggested not engaging because the sentiment "your code is crap" is not something that needs to be conveyed through text. That was just as true last year as this year. That some people have decided to overreact and stop commenting wholesale is up to them; there have been no policy changes that I am aware of. Commented May 14, 2018 at 6:27
  • 2
    @jpmc26: You communicate "unacceptable" with a close vote. You explain what is missing with a comment. Commented May 14, 2018 at 7:17
  • 2
    No jpmc26, you are not here to make people better Programmers. People ask questions of people they hope can help solve their problem, if in the process they end up better programmers that's great but I fail to see who decided the commentor know best. I can assure you there are many things I do people would say I shouldn't. Making suggestions and recommendations is fine but disparaging some one because they don't follow your rules is wrong. I have seen many cases of this behaviour here and on other forums. How are people to learn if you offend them to the point they stop listening to you.
    – dannyhut
    Commented May 14, 2018 at 9:20
  • 2
    This all boils down to the idealists who love to say "there is no such thing as a stupid question", which I personally think is such a thing as a stupid saying. The idealists are in war with the cynics, who believe that a percentage of the world's population are unfortunately morons and that's just how it will always be. These two groups form camps on SO meta and debate endlessly, where one group insists that there are no stupid questions and the other group insists that of course there are stupid questions.
    – Lundin
    Commented May 14, 2018 at 11:31
40

I usually call these situations "extenuating constraints"; the code that is presented to us is not code that anyone would actually want to use in production, but is code that the OP has decided to constrain themselves to.

The big thing to keep in mind is to respect the OP's constraints and try to answer their question as best you can within them. If your answer breaks those constraints, explaining why it does would be valuable.

If they still refuse your answer even after that, then there's not much else to say; disengage with them. You've done your part in answering their question; if they don't like your answer, they at that point have the right to downvote and not accept your answer.


As to the title of your question: if you want to call someone else's code "crap", then poke around at your repository and see what you've written three or four years ago. We all had to start from something. Otherwise I agree with Nicol's sentiment; what you're trying to say isn't inherently polite to begin with, so there's no benefit in you saying it.

9
  • 5
    You make an important point. Approaching the post from what "you" or anyone would use in production is at the very least ignoring the OP's constraints or position. Commented May 12, 2018 at 21:58
  • 10
    "The big thing to keep in mind is to respect the OP's constraints and try to answer their question as best you can within them." Nope. Nope. Nope. Never do this. Always tell them why their approach is fundamentally flawed. We have enough material for DailyWTF, thanks.
    – jpmc26
    Commented May 13, 2018 at 13:44
  • @jpmc26: Yeah... I can understand respecting constraints that are out of the asker's control, but this?
    – BoltClock Mod
    Commented May 13, 2018 at 14:30
  • 4
    @jpmc26: When the situation warrants it, sure. If they want to be obstinate and not accept that their way isn't suitable, then there's really no incentive in continuing the dialog with them since no one's going to get anywhere with it.
    – Makoto
    Commented May 13, 2018 at 16:30
  • 3
    I fully agree with you Makoto. We need to remember no one is perfect and we all started knowing nothing. To disparage someone for being at this stage is wrong.
    – dannyhut
    Commented May 14, 2018 at 9:34
  • 1
    Makoto I still don't know who decided that the commentor knows best. If you believe they aren't writing the code correctly send them an EMail and explain your concerns, don't just comment and leave. The comments should not be for debate and yes considering what I'm doing now I do see the irony. To comment on some ones programming style or method is inviting debate and has no place in the comments section of a forum, IMHO.
    – dannyhut
    Commented May 14, 2018 at 9:50
  • 2
    I welcome people call out my crap code. I do it to myself all the time. I don't understand how anybody would expect to get better if they're coddled all the time.
    – senfo
    Commented May 14, 2018 at 13:02
  • Some level of improvement can only come with experience. Everybody writes crap code in the beginning and without any experience it is hard to learn from many suggestions, set the user on track and help them to improve step by step.
    – johannes
    Commented May 14, 2018 at 23:40
  • 1
    Nobody writes 'i++ + ++I' code in the beginning, the middle or the end, except profs/TA's after a tequila too many. Commented May 16, 2018 at 6:11
15

Being nice is easy, just struggle doing it like me.

Disclaimer: I think judging someone's effort as "crap" is "pre-not-nice". Although it may be of the majority's opinion, "crap" is a not-so-nice way to pass subjective judgement on an individual's effort without consideration to their "self". ("self" being all things related to being oneself)

The people who I respect, if not admire, are those who, despite the circumstances, persist with niceness. This is true for more costly forms of learning like courses or bootcamps. No company will berate or pass judgement on a paying client no matter how "crap" their efforts are; there are better ways. And none of those ways includes voting them down or failing to provide guidance. And when guidance fails, you can still be nice!

Simply say:

"I've provided you with what I believe is the minimal amount of edit suggestions required to bring your post up to the standards which we hold dear; please address these issues. When you do, I will be glad to assist you further."

That's surely nice enough. But, more importantly, you've clearly set the boundaries for yourself and in some, if not most, cases, the community. That accomplishes what voting, flagging, and moving on does not.

If SO wants a more inclusive community, we have to provide the path to inclusion.

22
  • 2
    I sometimes comment on beginner code to point out how overcomplicated it is (and what a simpler way is), but I usually (or at least sometimes) try to say that it's normal for beginner code to be a mess. And that writing bad code in a language you're just learning doesn't make you a bad person. But usually I only comment like this when there's a reasonable question and it's just surrounded by a mess, not really like what this question is about. Commented May 12, 2018 at 21:00
  • I don't think making an edit (or suggested-edit) on the question really fits with what this meta question is about. I think this is about handling questions with serious separate issues in their code attempt at doing whatever the question title says they're asking about. So an edit wouldn't be appropriate at all; if you want to correct the code you'd post an answer. Commented May 12, 2018 at 21:04
  • @PeterCordes, fair enough. To be honest, I'm interested in learning about and adhering to what I consider the new expectations of SO. Like I meant to say, we should consider ways to progress past these issues or at least hit an obvious wall where it's clear the OP has no intent to adhere to even the basic expectations. Commented May 12, 2018 at 21:07
  • That will squash the issues brought about by those who I struggle to identify with. I put a lot of effort into my questions, others don't, but how do I bring them to that point? Voting, flagging, or closing, alone, in may cases, doesn't do it and taking that approach seems to be at least discouraged as of late. Commented May 12, 2018 at 21:12
  • 19
    You forget the goal of the site, we are building a knowledge base for programmers, not a one-to-one tutorial service for clueless people. Those questions should not exist in the first place, and no future visitor will benefit from them, they are garbage. "voting, flagging, closing" will trigger the garbage collector to clean up the site, this is all we should do.
    – llllllllll
    Commented May 12, 2018 at 21:15
  • 1
    @liliscent, that's obvious. But what's not obvious is how we reconcile the current concerns against our own expectations. I fully understand your point and have done my best to adhere to it. But am I adhering to a subset of user's interpretation of it? It seems so. As we see it, we are moderating the site: oh, this is bad -> close -- this is x -> action. That isn't very different than passing on every person who doesn't immediately know everything. If we want better quality through means other than try/fail/try-again, which seems to not work, we have to be more creative. Commented May 12, 2018 at 21:23
  • 7
    -1 for supposing it is desirable or even possible for a free library website to have the same relationship to a minority of its patrons as an expensive bootcamp has to each of its customers. What's more, your assertion that "No company will […] pass judgement on a paying client no matter how "crap" their efforts are" isn't even true in the first place. Or have you never heard of courses passing out failing grades? Commented May 13, 2018 at 5:32
  • 4
    You forget the goal of the site, we are building a knowledge base for programmers, not a one-to-one tutorial service for clueless people Well I'm kinda questioning this statement, to be honest. I mean, we're all "don't just ask questions, provide code so that we know what you tried" which actually switch the focus from a general answer to precisely a one-to-one help session. Aren't we contradicting ourselves a little bit? Commented May 13, 2018 at 12:55
  • 3
    @KevinGosse "What have you tried" shouldn't be seen as a requirement in and of itself. Asking for that should aim at making the question answerable without guessing, or adequately scoped, or easier to understand, or more useful to future readers. Before asking that (or, for that matter, before asking for an MCVE) from an OP, it is worth asking oneself whether it will help towards those goals.
    – duplode
    Commented May 13, 2018 at 15:51
  • @NathanTuggy, thanks. I wasn't clear; I wasn't suggesting the relationships should be the same. Getting help on SO isn't like formal training or bootcamps. I was saying, if you're going to volunteer to help, don't find creative ways to tell someone their code is crap or flag it as crap, help as much as you're willing then close it off with a nice see-ya later. Commented May 13, 2018 at 21:53
  • @NathanTuggy,I also didn't mean passing final judgment like "failing grades"; it's Q&A like asking for help while learning. Trying to get help might go better if it didn't end with your code being called crap. I believe in cases like OP's where you've already decided to help, don't end it bad by being an ass. It gives fuel to the arguments being laid against the community and our desire for quality is overshadowed by the tone. Commented May 13, 2018 at 21:53
  • 1
    @KevinGosse: Well tbh finding the balance between "tightly-scoped enough to be immediately useful to someone with an essentially identical problem" and "loosely-scoped enough to usually be useful to more than a dozen people" has been one of the major challenges to exercise meta since the site started. Commented May 13, 2018 at 22:06
  • @ChiefTwoPencils: It's perfectly reasonable to tell people that downclosevoting is enough without insults, or even rude remarks about someone's code, but the analogies used don't appear to match very closely, and have unfortunate implications. Commented May 13, 2018 at 22:07
  • 2
    This is pure vitrol. You must at all times separate a persons work with the person itself. If someone says my code is "crap", it's my problem if my "self" is hurt. I agree however, that "crap" is not a very nice way of putting it, and would not express myself that way. However, you have all the wrong reasons, and this type of reasoning it vey dangerous.
    – vidstige
    Commented May 14, 2018 at 19:10
  • 1
    Just to clarify, I felt your took a wrong turn already in the disclaimer. Here an unreasonable, selfish, and unfair focus is put on the "self" of the asker. When you look at questions at SO, you marvel at how many people have read them, although only (usually) one person asked the question. Therefore, when giving feedback on questions, it's of utter importance that the community at large is considered before the "self". However, I still agree one should be nice. And extra nice to new-comers. I feel for example it's nice gesture to start the comment with "Welcome to Stackoverflow" or similar.
    – vidstige
    Commented May 15, 2018 at 1:04
7

If the mistakes have already been pointed out, but the OP refuses to listen, there is nothing much that can be done, and there is also little reason to further escalate the argument (I'd say "trying to say the code is crap" is a bit of a red herring). Posting your fix to the blatant XY problem and letting the OP make of that what they will could be an appropriate course of action, depending on how useful you think the answer would be. Downvoting the question as not useful and disengaging could also make sense.

(I'm not making a blanket suggestion about closing, as it really depends on the individual situation. "Too broad", for instance, might apply if there are many serious mistakes that would have to be addressed.)

2
  • In this particular case I don't think Y is solvable but otherwise agree.
    – ivarni
    Commented May 12, 2018 at 15:17
  • 1
    This. Harping on is inherently not nice and a waste of your time. Also, others will often pick up and take your place in the chorus of voices, at least by upvoting your previous constructing comment.
    – tripleee
    Commented May 14, 2018 at 4:49
5

It's perfectly possible to say something which is truthful and helpful yet won't risk a "be nice" violation:

"You rejected the suggestions which I offered you on how to improve(/clean/refactor) your code and fix the errors, so I'm unable to help you (further)."

and also "Asking for solutions without fixing the code is not what SO is for".

6
  • Yes. That's where I have a tendency to get snarky. I really have to unlearn that. Thanks for the suggestions.
    – Mr Lister
    Commented May 14, 2018 at 9:10
  • 1
    @MrLister: I have empathy because I'm sometimes also on the receiving end of that situation. Sometimes a respondent has not made a compelling case why I should rewrite things their way, sometimes the advantages are not obvious or are outweighed by disadvantages, sometimes a respondent has misunderstood my question, sometimes even a respondent is (gasp) wrong, sometimes the OP is not in a learning mood and just wants working code urgently. It helps to stop and look at the exchange and see if they misunderstood the advantage of what you're suggesting, or where things went south.
    – smci
    Commented May 14, 2018 at 9:30
  • I recently finished a comment with: I wish you luck. With a lot of effort I managed to omit the you're going to need it part. Having the unsaid part echoing through my head made me fell better.
    – Oldfart
    Commented May 14, 2018 at 12:48
  • 1
    @Oldfart: what is the toxic snark level with you guys? :) If someone rejects our advice, it's just part of life.
    – smci
    Commented May 14, 2018 at 13:08
  • 1
    That snarl has come out once in the last six months. I don't mind stupid questions. I do mind moronic code which you spend 30 minutes on to clean up and point out where they are wrong, then to hear in derogative wording that they know better. Those 30 minutes I could have helped somebody else.
    – Oldfart
    Commented May 14, 2018 at 14:10
  • 1
    @Oldfart the problem is no one decided that you know better. May be the OP is right and their way of doing something is the right way not yours. This sort attitude is the problem. You say your right they say their right, to get upset about them saying your wrong is a bit like the pot calling the kettle black.
    – dannyhut
    Commented May 14, 2018 at 22:13
5

If the purpose of replying, at all, is to be helpful, either to the OP or to the community, then perhaps the approach to take is to use it as a chance to educate about the circumstance.

For example, you could say, from the question, I would suggest we could represent the problem or situation as follow:

Your version of the critical code elements that represent the actual problem

For situations like this, an approach to a solution may take the following form:

Your approach to solving the problem

You're not talking about the person, their code, their understanding, etc. You're looking at the logical or technical situation and trying to share wisdom with those who come across the question so that people in similar situations may find useful directions towards solving their problems.

It's probably a good idea never to make the solution about the person, but about the problem?

1
  • 1
    "It's probably a good idea never to make the solution about the person, but about the problem?" Yes, this is psychology 101 - address the problem, not the person
    – TylerH
    Commented May 14, 2018 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .