9
\$\begingroup\$

I answered a question, followed the rules, then it gets downvoted and two other answers which are pretty much the same (you decide) don't. I feel the loss of the points.

I think one of the downvoters was nice enough to say why, which was good, but I totally disagree with the comment.

What is wrong with this answer?

\$\endgroup\$
  • 1
    \$\begingroup\$ Your answer has two downvotes. One of them added a comment. Doesn't this comment answer the question about what is wrong with it? codereview.stackexchange.com/questions/145611/… You might disagree with it, but the comment is still there, and the downvote also. \$\endgroup\$ – Simon Forsberg Nov 2 '16 at 22:30
  • \$\begingroup\$ @SimonForsberg sorry don't know what to respond with, I've said all of this in my question? \$\endgroup\$ – Geek Nov 3 '16 at 9:12
  • 1
    \$\begingroup\$ Respond to the comment either acknowledging the points and correcting them, disagreeing with explanation or.. leave it open for interpretation. \$\endgroup\$ – Raystafarian Nov 3 '16 at 11:05
  • \$\begingroup\$ I just replied to the comment, as discouraging as it was I don't want to further discourage people for stating their reasons why they downvoted. \$\endgroup\$ – Geek Nov 3 '16 at 11:10
  • 1
    \$\begingroup\$ All you really need to do for the comment is understand the feedback it has given you and try to avoid putting yourself in a similar situation in the future to avoid that type of downvote again. Also, remember upvotes are +5 rep and downvotes are only -2, so it's a net positive anyway and no reason to be discouraged. Remember, we're all here to share and learn and some sites in the network are more downvote friendly than others. \$\endgroup\$ – Raystafarian Nov 3 '16 at 13:06
  • \$\begingroup\$ @Raystafarian question upvotes are +5; answer upvotes are +10 ;-) \$\endgroup\$ – Mathieu Guindon Nov 3 '16 at 13:50
  • \$\begingroup\$ @Mat'sMug hahaha yeah. Sometimes my brain just stops working. \$\endgroup\$ – Raystafarian Nov 3 '16 at 13:57
  • \$\begingroup\$ Maybe the system should encourage the user to give a reason for a down vote. E.g. down vote: -5 reputation points, down vote with reason -2 \$\endgroup\$ – Frode Akselsen Dec 23 '16 at 2:59
26
\$\begingroup\$

Voting (in either direction) is a very subjective and personal thing. As you've mentioned, you've already had a comment on your answer explaining where one person feels your answer is lacking. Whilst you've posted this question, you haven't responded to the comment. You may 'totally disagree with the comment', but you've not provided an explanation as to why the comment is incorrect which leaves that last comment on your post as a negative one. This draws people's attention to the negative aspects of the post meaning that future visitors are more likely to down vote. If you believe a comment is wrong, then you should consider responding to it (either by editing your post appropriately or by commenting). That said, it may not make any difference.

As I've said, voting subjective and isn't necessarily a reflection that a particular post has anything wrong with it. The following are all possible reasons for a person down voting:

  • The answer suggests using known bad practices
  • You've posted code that has a bug in it
  • The answer hasn't considered edge cases which I think are important
  • The answer adds nothing to the existing answers posted
  • The answer uses/suggests an approach I don't like
  • That's not how I would have done it
  • I don't think you should have answered the question (it's off topic / lacks detail)
  • The answer is incomplete
  • The answer links to a resource I don't like
  • The answer lacks detail
  • The answer has too much detail
  • You've simplified the problem too much
  • You've over complicated the problem
  • I don't like the tone of your answer
  • You've said something I don't like in the answer
  • I got out of bed the wrong side this morning and your answer was the first one I saw.

Whilst there are some restrictions on who can down vote, they're not really very strict (you only need 125 rep), so now and again you will encounter disagreements / rogue votes it's part of the cost of participation. Generally speaking they'll balance out with people giving you more up votes than down votes. It only becomes a problem if you notice a pattern of down voting of your answers over a period of time, where other people are also voting those answers up.

\$\endgroup\$
  • 14
    \$\begingroup\$ I just got out of bed UGH. -1. I finished my coffee, +1 \$\endgroup\$ – Raystafarian Nov 3 '16 at 11:03
  • \$\begingroup\$ Thank you this is very helpful. I was going to reply to the comment on the answer in question, but i wanted to get a view on how I should respond. \$\endgroup\$ – Geek Nov 3 '16 at 11:06
  • 2
    \$\begingroup\$ You're missing "I don't understand this answer and instead of learning about the stuff written here, I'm just going to downvote and say that it's wrong, although it might not and I'm entirely ready to start a loooong discussion why you're answer is wrong". \$\endgroup\$ – Zeta Nov 8 '16 at 19:51
10
\$\begingroup\$

Let me give this question a specific answer. You say your answer isn't notably different from the other answers. Let's check that against the "facts". For context: Here's my explanatory comment:

Your first point is not sourced at all ... I'd say [citation needed]. The second point is a link-only answer, which is discouraged and the third reads like an advertisement. Overall IMO your answer suffers from a credibility problem :( -1

Now let's go along your answer, comparing it to the other answers:

  1. Running Parallelism is for better efficiency and speed when executing the same code repeatedly.

This don't quote any sources. It's also lacking elaboration. Overall this is a blanket statement and I'm sure I can come up with a few scenarios where this is not true.
Let's compare this to the answer by Peter Taylor:

Firstly, the purpose of AsParallel is to split work between multiple threads; the purpose of async/await is to avoid the need for multiple threads when handling things such as I/O. So combining AsParallel with async/await is a code smell.

This is an easily verifiable claim, and at that it's one I know to be true.


  1. You can get threading wrong for not watching out for common threading issues. Msdn link has some good General Recommendations.

Well ... this is only a link. For the sake of argument let's assume that msdn went down for a while. At this point that sentence becomes utterly useless, because there could've been anything behind that link. Let's also ignore that OP has to jump through hoops to get usable information out of this.

Let's compare this to RobHs answer:

This is the sort of code that will bite you later when you find out that a synchronisation context can cause a deadlock. See Stephen Cleary's blog post on the subject of an async deadlock.

While this isn't significantly more information than your link, it is explained more than yours, because it's coupled with a direct observation of the code under review. As such it's much more valuable, because it observes and names a problem. Your answer just repeats some conventional wisdom ("Multithreading is hard").


  1. Not really, async and await is not the same as Parallelism as you might be thinking, there is an excellent course on Pluralsight which explained what it was and how it was properly implemented. - I'm not sure if I can provide a link can a moderator let me know?

IIRC SE moderators had some minor issues with Pluralsight quite a while back about advertisements to their courses. I might be wrong here, but alas. The question you pose there is meta-concerns. They don't usually go well in an answer and should be cleared up here on meta or in chat.


The next section is basically the usable part of the answer (as of now). Unfortunately Peter Taylor also has that information in their answer, a bit more extensive and clearer. The tipping point for me was already reached, but if that wasn't enough the answer also includes an incomplete rewrite of the code, which is completely moot. The actionable advice boils down to a single sentence ("[..]delete method1 and use Async and await all the way through the code."). Any C# programmer with a few months experience should be easily able to piece together what the code looks like after applying that.


I hope you understand the reasoning behind my downvote a bit better now :)

\$\endgroup\$
  • 1
    \$\begingroup\$ Sorry no again I dont agree. I would also correct the statement made that I answered the question 2 hours earlier. I answered the question first and was commenting with the OP. Peter Taylor answered some time after. I remember when RobH answered while I was adding a comment which had the same link he had. You're making it sound like i plagiarized his answer. \$\endgroup\$ – Geek Nov 3 '16 at 14:08
  • \$\begingroup\$ Just checked Peter Taylors answer, his was added the day after (02 Nov @12:09). Mine was 01 Nov @ 13:54 \$\endgroup\$ – Geek Nov 3 '16 at 14:12
  • 10
    \$\begingroup\$ @Geek It's often possible to post a better answer without necessarily being the first. Personally, I agree with Vogel's points here. If you don't agree with the points Vogel has made here (after the edit), then please elaborate about what you don't agree with and why. \$\endgroup\$ – Simon Forsberg Nov 3 '16 at 16:18
  • 1
    \$\begingroup\$ "Unfortunately it's basically duplicating what Peter Taylor mentioned in their first paragraph" <- This sentence is not fair given that OP was first with his answer. It does look like you are saying OPs answer just copied PT's answer. \$\endgroup\$ – Winther Nov 10 '16 at 19:00
  • \$\begingroup\$ @Winther do you have a better idea for a formulation? \$\endgroup\$ – Vogel612 Nov 10 '16 at 23:43
  • \$\begingroup\$ @Winther, that sentence is also not fair because my code compiles. \$\endgroup\$ – Peter Taylor Nov 11 '16 at 11:34
  • \$\begingroup\$ @Vogel612 "Unfortunately Peter Taylor also has that information in their answer (and wrote it better/clearer)", depending on what's appropriate. Specifically using the word "duplicating" implies that the person you're addressing did the action, rather than it being the case that two people had the same information. \$\endgroup\$ – SuperBiasedMan Nov 11 '16 at 11:52
  • \$\begingroup\$ @SuperBiasedMan I love it. Edited. \$\endgroup\$ – Vogel612 Nov 11 '16 at 12:03
  • \$\begingroup\$ @SuperBiasedMan, I still feel that that wording is an insult to my answer on the question under discussion. \$\endgroup\$ – Peter Taylor Nov 11 '16 at 12:25
2
\$\begingroup\$

I've tried to change your code, but as its not complete I can only attempt to fill in the gaps for you.

public async Task<IEnumerable<Data>> GetDataAsync()
{
    //There are multiple blob address where the data is held. The code creates, in parallel multiple tasks for each address.
    //It returns tasks that will be run in Async pattern
    var tasks = multipleBlobAddress.AsParallel.Select(async blobAddress =>
    {
        IEnumerable<Data> task = await GetDataFromBlobsAsync(blobAddress);
        return task;
    });

This spins off a bunch of threads, runs the async code across the various threads, and waits for the results. There's a compile-time error in that it tries to assign a value of type Data to IEnumerable<Data> task, although that error was introduced by your change further down; if this is corrected then tasks will be either of type IEnumerable<Data> or of type IEnumerable<IEnumerable<Data>>; either way, the comment is wrong.

    //Awaits all tasks to complete
    var completedTasks = await Task.WhenAll((IEnumerable<Data>)(tasks));

If that cast is necessary, var isn't doing its job; the other possibility is that it's a runtime error. And here there's a second compile-time error: Task.WhenAll takes an IEnumerable<Task>, not an enumerable of results. And there's a logical error: the tasks have already been awaited in the Select, so there's no longer anything to wait for.

In summary, the changes proposed in the answer make the code worse, not better, so the real question isn't why it has downvotes but why it has upvotes. I can only assume that the people who upvoted it didn't read it carefully.

\$\endgroup\$

You must log in to answer this question.

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