67

The question C/C++ fastest cmath log operation is about how to do the log operation faster than naïve.

The second-highest voted "answer" is just

How about this: write the code so it's readable and clear. Use it. If, and only if, this clean implementation is too slow to be used, then optimize it.

which is clearly useless for anyone who actually cares about the question.

I flagged this is "not an answer", since it's not, but it was disputed. That makes me sad, and being sad is bad.

So, am I insane? Should this be kept? Why did this survive the flag?

19
  • 24
    It's often held that if two questions have exactly the same answer, the questions are duplicates. Considering this as a valid answer would suggest that all performance questions are duplicates, which they clearly are not. (Yes, it's a silly argument. But do we really need a "profile first!" answer on every performance question?) Jan 30, 2016 at 8:38
  • 4
    Not an answer flags are way too easy to get disputed. People interpret "attempt" in widely different ways and, evidently, there are people that think that the text you quote is at least a valid attempt at answering the question, even if it ultimately fails. In the meantime just downvote and comment stating why you think that content shouldn't be there.
    – Bakuriu
    Jan 30, 2016 at 13:19
  • 7
    Many performance questions receive at least one reflexive comment like "Premature optimization!". This is not useful. Appears to be bike-shedding (people saying the only thing they understand even if it's not essential). Also, the commenter can't know whether the optimization is actually needed. Downvote if it's an answer. Flag the comment for chattiness if it does not help resolve the question. Otherwise, ignore.
    – usr
    Jan 30, 2016 at 13:42
  • 7
    It should be a helpful comment or even better a remark in an answer. that actually does address the question being asked. Many users do that because they want to help with the real issue that the asker might be too ignorant to understand. In those cases, it's just great (still not by the book, though). There are, sadly, smart-asses who don't realize the depth and just want to throw in their 5 cents. Often, not even correct ones. Or people who arrogantly assume that they know better than you (in some cases, correctly, of course). And I agree - being sad is bad. Stop being sad. Jan 30, 2016 at 14:00
  • 1
    Just another case of "What is temperature outside?" being answered with "Sky is blue." and your flag gets disputed or declined because that is some kind of answer to something. It seems that only answer flags that pass most of the time are link only answers, thanks, or questions asked in answer. Jan 30, 2016 at 14:14
  • 12
    The question is dreadful, it does not state how fast it needs to be. The strategy to purse is entirely different if it needs to be ten times faster instead of 1.5 times faster. And you'd better be prepared to give up on, say, accuracy if x10 is the goal. The simple conclusion to draw is that the OP has absolutely no idea, he did not set a goal and never tried. Which makes that an entirely appropriate answer. Ask a better question. Jan 30, 2016 at 15:31
  • 4
    @HansPassant: Is it not better, if the question is so terrible it can't receive a proper answer, to refrain from answering and instead use comments and/or closure to make sure it gets fixed before answering? Jan 30, 2016 at 18:12
  • 2
    Meta-effect kicked in and the answer was removed, apparently. Jan 31, 2016 at 17:08
  • 1
    That was better converted into a comment rather than completely removed IMHO.
    – T J
    Feb 1, 2016 at 5:35
  • 2
    Despite all the voting on the answers below, the real answer to your question is simply that you misused the NAA flag, as indicated by the most heavily downvoted answer. The correct action would be downvote and vote to delete if you can, then move on. No moderator intervention is necessary in this situation. I get that NAA's description is confusing, but it's still sad that people still don't understand how NAA is supposed to work.
    – jpmc26
    Feb 1, 2016 at 8:10
  • @jpmc26 Moderator intervention has nothing to do with it, AFAICT, else link-only answers wouldn't be recommended to be given NAA flags.
    – Veedrac
    Feb 1, 2016 at 8:23
  • @Veedrac Moderation has everything to do with proper NAA usage. See this from Shog. I can't find it now, but I know I've read something along the lines of, "When you flag, you are asking to bypass the normal community measures and have a moderator delete immediately." And if you'd read the link in the answer I referenced in my previous comment, you would find the reason why link-only is considered bad and why it's appropriate to handle those with extreme prejudice.
    – jpmc26
    Feb 1, 2016 at 8:38
  • @jpmc26 Your link does clarify things, but I think I'm still right - there's not a single question valid for Stack Overflow for which this answer is valid, so the "no context" issue doesn't really apply.
    – Veedrac
    Feb 1, 2016 at 8:55
  • 1
    @Veedrac You really believe that there is no question on SO about optimization where the best answer is, "Don't optimize this"? Whether that's the case in this specific instance is one thing, but I think you over-estimate the level of knowledge of every single last question asker here if you think it's illegitimate it every case. And worse, how would a moderator even know whether or not such questions exist? Here's the bottom line: it is an attempt to provide a solution to the problem: "This isn't a problem. Look elsewhere." It may not be right this time, but it is an answer.
    – jpmc26
    Feb 1, 2016 at 8:59
  • 2
    @jpmc26 But it's not saying "this isn't a problem". It's not arguing that this instance is different. It's just a general disingenuous maxim about profiling first. If there was some argument that pertained to an actual, concrete issue, the non-answer would be less, well, non-answer-y.
    – Veedrac
    Feb 1, 2016 at 9:20

6 Answers 6

41

It makes for a great comment. It might even be a reasonable answer on Programmers. But without actually giving the optimization... it's not an answer. Same way as an "answer" that just tells the asker that what they want to do can't be done... without trying to provide a workaround, or an exhaustive reasoning, or anything.

Why the flag was disputed, I'm not sure. Perhaps some reviewers were thinking of the Programmers fit. (Even on Programmers, it would need at least an explanation of this general maxim's specific applicability to back up the assertion to avoid downvotes or worse.)

9
  • 5
    neither the question, nor the "answer" are good fit for Programmers. Whoever might thinking about something like that, would better give a read to What goes on Programmers.SE? A guide for Stack Overflow
    – gnat
    Jan 30, 2016 at 15:50
  • @gnat: The question does not go on Programmers. The answer could, although it's still fairly sparse; it's giving advice on programming practice. Jan 30, 2016 at 18:08
  • 4
    @NathanTuggy at Programmers requirements to the answers are the same as at any other SO-like site in the network, How to Answer guidance is the same. Tangential musings, hand-waving, missing explanation get voted down and deleted
    – gnat
    Jan 30, 2016 at 20:29
  • @gnat: I'm not convinced missing explanations are a good reason to delete answers even on SO. Downvote, sure. Delete, no. (On e.g. ELL I would agree, and routinely delete answers without mercy if they don't have an explanation, because gimmetehwordz is a lot less generalizable than gimmetehcodez if no explanation is provided.) Jan 30, 2016 at 20:33
  • 3
    missing explanation is a good enough reason to delete answers at Programmers
    – gnat
    Jan 30, 2016 at 20:45
  • 1
    @gnat: I would really love to have that kind of culture over here on SO.
    – nhahtdh
    Feb 1, 2016 at 3:16
  • 1
    @nhahtdh: Make the case for it, but so far, it's generally been the position here that e.g. code-only answers shouldn't be deleted for that reason alone; if there's enough to piece together a reverse-engineered explanation, that's enough for SO. Different sites, different standards. Feb 1, 2016 at 5:07
  • 'Giving the optimization' would probably make the question too broad. You'd have to know what special circumstances apply that might allow you to write code to out-perform the probably finely-honed standard library version of the log function. If the standard library version isn't finely honed, of course, there may be opportunities to improve the performance significantly without compromising accuracy over the relevant range — but there might be more mileage in finding a better standard library than in trying to reimplement it. Feb 2, 2016 at 1:42
  • 2
    @JonathanLeffler: That's a reasonable enough argument for closing the question. It's a terrible argument for answering it on that basis. If the answer cannot be fit into the question without making the question unsuitable, the question is already unsuitable, and no answer should be posted. Feb 2, 2016 at 1:54
26

"Profile first" may help the asker. But questions aren't just for the asker, they're for everyone arriving from Google. To many of those people, "profile first" is noise -- either they're searching because they have profiled, or they're searching out of curiosity rather than need and thus have nothing to profile.

Annoyingly, I usually can't profile the asker's code to decide if optimizations are worthwhile, because they provide at most an MCVE, not their full application. And even if I did edit the question to say "I have profiled my application and I know an improvement here will significantly improve my program's overall performance", my edit would probably be rolled back on the grounds of invalidating the "profile first" answer. So the noise is legal forever.

What I can do is downvote answers I don't think are useful, and I do. I don't know if that's enough discouragement to prevent "profile first" from being posted as an answer on every performance question that doesn't specifically bar it, but I did what I can.

10

I would forget about whenever that answer should be flagged, deleted or dipped in acid. I would focus on something "more important", your disputed flag. The flag was disputed because not everyone agreed it should be deleted. As long as the result of the review isn't unanimous, you will get a "disputed" flag. And anyways, even if the flag was marked as "helpful", the answer wouldn't be deleted without moderator intervention, since review can't delete answers with score >1.

4
  • Note that the score is no longer an issue for follow-up flags.... Jan 30, 2016 at 18:11
  • @NathanTuggy my point was more of the kind "don't flag upvoted answers and expect review to do the right thing"
    – Braiam
    Jan 30, 2016 at 18:15
  • So if it goes to review and six users recommend deletion, what happens? The review just completes with no action? Jan 31, 2016 at 2:30
  • 3
    @JeffreyBosboom an upvoted|accepted answer? The flag is marked as helpful and an auto-flag is raised for moderators to handle the situation. I can't find the reference now, but I'm sure is there... somewhere.
    – Braiam
    Jan 31, 2016 at 2:41
7

I'm not a big fan of answers saying that the OP is trying to do the wrong thing, but I wouldn't say that all "Don't optimize" answers are inappropriate.

If a user is trying to optimize a certain component, and that component is guaranteed not to make a non-negligible contribution to overall running time, then saying "Don't optimize this specific component" may be an appropriate answer.

2
  • 1
    I agree with this.
    – hek2mgl
    Feb 1, 2016 at 8:50
  • 1
    I agree with this. Several times I have answered "how do I do X" with "Don't do X because..." When it's the best answer it should be given as an answer.
    – Ben
    Feb 1, 2016 at 9:13
-3

This rules-lawyering is out of hand now.

You are worrying about "Does This Meet The Definition Of Not An Answer" instead of "how can I best help the questioner".

I am interested in helping other programmers, and if the best possible answer to a question "how do I do X" is "don't do X because..." then it should be given as an answer, not as a comment.

Instead, the meta-bullies have piled on to a perfectly good answer, which was probably helpful to the original poster (if they were wise enough to heed it) and voted the answer into oblivion.

Who does that help?

5
  • 1
    "a perfectly good answer, which was probably helpful to the original poster" → I can not fathom as to how you think this. To me it's plainly obvious that the answer helped do nothing except spread some kind of perverse self-congratulatory zeal.
    – Veedrac
    Feb 1, 2016 at 12:14
  • 1
    @Veedrac, I do not know why you cannot fathom this, and I don't care to speculate. If you understand an argument and reject it, that is one thing. But nobody knows everything: If you don't understand an argument, consider that it might be motivated by some knowledge or experience that you don't have.
    – Ben
    Feb 1, 2016 at 12:30
  • 2
    If one says they are confused about your reasons to an opinion, saying that it might be justified by knowledge beyond them is nearly a tautology. Of course it's justified by knowledge beyond them, else they'd share the opinion. One makes argument by divulging each other's private knowledge such that the other person may come to the same conclusion.
    – Veedrac
    Feb 1, 2016 at 12:40
  • 3
    @Veedrac, if you do not understand why the example might be a helpful answer, I suppose it is because you lack experience of seeing people spend many hours trying to optimise something of no consequence. The motivation is not the pleasure of mocking poor choices, but to help the person by pointing out that the choices are poor so that they can stop making them.
    – Ben
    Feb 1, 2016 at 12:52
  • 5
    If I ask a question on SO, it's for one of two reasons: 1) I know more or less what I'm doing and need assistance filling in the gaps, or 2) I have no idea what I'm doing and am oblivious to my lack of knowledge. In the first case, I would want a straight answer to my question, not a vague pseudo-answer that merely sidesteps my issue. In the second case, someone should tell me in a comment that I'm clueless and should do more research. In either case, an answer like the example in this meta question is not helpful.
    – Mage Xy
    Feb 1, 2016 at 20:40
-9

Such recomendation post is an answer ... but does not answer given question (yes, Stack Overflow allows that). It is nice candidate for downvote (as not useful), but not for NAA flag.

There is nice post on meta SE: Your answer is in another castle: when is an answer not an answer?.

Just remember: if the text of the post contains an honest attempt at answering the question, then it is an answer - so don't flag it otherwise, and if you do, don't complain if your flag gets declined.

6
  • 3
    NAA confusion strikes again. This is the correct answer about why it was declined. This does not imply in the slightest that we can't downvote the answer or vote to delete it, but this is definitely isn't the kind of thing a moderator should be involved in (which is why the flag exists).
    – jpmc26
    Feb 1, 2016 at 0:13
  • @jpmc26: What do you mean by vote to delete it in relation to the answer? Answers can not be voted to delete, aren't they?
    – Tsyvarev
    Feb 1, 2016 at 6:40
  • @Tysvarev See here: "Answers can also be deleted by the community." It's a 10k privilege.
    – jpmc26
    Feb 1, 2016 at 8:06
  • @jpmc26 Why wouldn't mods be involved in deletion when a non-answer gets votes from the masses and the power users can't vote to delete? Feb 1, 2016 at 8:43
  • @MatthewRead Users can vote to delete answers; I don't know what you mean. And why should a mod get involved when the community is solving the problem? See here: "It's not always enough to read the question, it's not even enough to understand the question - ... you need a solid understanding of the answer and the ability to judge whether or not it might actually solve the underlying problem. Whether a moderator or reviewer is able to do this is impossible to predict." Doubly true for problems that may or may not actually need solving.
    – jpmc26
    Feb 1, 2016 at 8:47
  • 1
    @jpmc26: According to page you refer, it is 20k privelege (trusted users) for vote-to-delete answers. Anyway, thanks for pointing to that possibility.
    – Tsyvarev
    Feb 1, 2016 at 10:18

You must log in to answer this question.

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