17

The topic of this question has been circling around in my mind for quite some time now as I work on projects. I spent parts of three days researching and composing this question and writing code to demonstrate it. I included links to resources and explained their relevance to the question. I outlined the issue as succinctly as I could, which still required quite a few paragraphs due to the relative complexity of the topic, in my mind. Yet it was immediately met with 3 downvotes and not much useful help.

Where did I go wrong, and how could I improve it?

Long running CPU-bound synchronous implementation of an interface that returns a Task

23
  • 7
    You did get a comment speculating on the reason for the downvotes, didn't you?
    – yivi
    Commented Aug 30, 2018 at 12:29
  • 3
    Yes, but I think the comment was off-base. The "minimal" in [mcve] refers to code, not to the substance of the question.
    – rory.ap
    Commented Aug 30, 2018 at 12:29
  • 30
    On first glance: Damn, that's a wall of text. "Ain't Nobody Got Time for That!"
    – Cerbrus
    Commented Aug 30, 2018 at 12:29
  • 9
    It's a wall of text...because of a complicated question, as I stated. That's why I put a TL;DR at the top.
    – rory.ap
    Commented Aug 30, 2018 at 12:30
  • 9
    And maybe the down-voters are as "off-base" as that commenter. You shouldn't dismiss feedback if you are looking for down-vote reasons.
    – yivi
    Commented Aug 30, 2018 at 12:30
  • 6
    And for people who don't want to read a "wall of text", just move on. Why the DV?
    – rory.ap
    Commented Aug 30, 2018 at 12:31
  • 6
    @rory.ap: Maybe because they expect an MCVE. To them, that can be a valid downvote reason.
    – Cerbrus
    Commented Aug 30, 2018 at 12:37
  • 2
    @Cerbrus -- how much more minimal could I make my code? It has to be complete...
    – rory.ap
    Commented Aug 30, 2018 at 12:41
  • 1
    The point is that the question itself should also be as concise as it can be. That's why I removed quite a bit in the edit.
    – Cerbrus
    Commented Aug 30, 2018 at 12:44
  • 8
    When it comes to votes, reality isn't as important as perception. Whether they are right or wrong, people seeing your question could very well go "wow, this just can't be an MCVE" and downvote based on that. Should they read your question fully and try to understand it? in all likelihood, yes. Is your code as minimal as needed? It does look like it. Is it possible some people make mistakes? yes, entirely.
    – Patrice
    Commented Aug 30, 2018 at 12:47
  • 4
    I don't understand the downvote. I can play the devil avocat for anything, but here I fail. I personnally won't upvote it before reading completely, and the related ressource. But for me downvote are for bad question. If I were you I will assume that a cat click the dv button. Commented Aug 30, 2018 at 12:54
  • 10
    @rory.ap Maybe because they think a wall of text makes for a poor question. Why does anyone downvote anything instead of "just moving on"? It's called curation. Commented Aug 30, 2018 at 13:26
  • 3
    It's verbose and long and just so long-winded, it would me a long long time to get head around said question, even if I were an expert on the topic. tldr: it's wordy
    – nz_21
    Commented Aug 30, 2018 at 14:01
  • 3
    Now I'm looking at my question again after all these "wall of code" and "too verbose" comments, and I'm thinking....really? You folks have too low a tolerance for pain. It's really not that verbose. Remember, verbosity means "using more words than are needed" not "is kinda long". I feel I used enough words to explain my situation. Just my opinion I guess.
    – rory.ap
    Commented Aug 30, 2018 at 14:40
  • 2
    I think your question is reasonable and I disagree with the downvotes, which look to me to be from people who didn't even read the question and just downvoted based on a quick glance at the length. Seeing what happened here, I'll be extra careful to be concise on SO from now on. Commented Aug 30, 2018 at 16:17

3 Answers 3

14

I've avoided asking questions where I felt like I needed a white board to ask it 'live' as people read it, but that was only because I tend to predict and optimize for time. I knew I could probably make more progress with the problem in the amount of time it would take me to explain it and wait for answers. That was sometimes disappointing, because it caused me to abandon some ideas that would have become the worst legacy disasters anyone would ever inherit.

All kidding aside, there's nothing fundamentally wrong with your question. I was a little surprised at the reception; two years ago it was usually just "crickets chirping" if you posted something and folks thought sure looks interesting, but ain't nobody got time for that. You'd see the same questions again after a bounty was placed.

I'm also not an expert when it comes to what you're talking about in the question, but the pattern seems incredibly strange to me, so I can see why someone might have said "asks a lot, and not all that useful to future visitors". My take on this is that you got so incredibly focused on capturing such a huge breadth of context to frame the problem, you forgot to put clear emphasis on the 'what' and 'why'. But that's a bit of a nitpick, your question passed my litmus test which is it made me want to go digging to figure out what you're doing over there -- even though I don't have time to do it.

I thought it was worth an up-vote, it seems like the kind of thing someone with the right kinds of war scars might passionately answer. I think you just got a little lost getting all of that aloof, but it's new to me that you'd lose the benefit of the doubt (based on research and effort presented) as to usefulness.

But, then again, If someone had a quick 20 minutes to go answer questions as a warm-up exercise, and ended up burning that while trying to parse your question a few times, I can kinda understand the reaction.

TL;DR: I think you need a better summary of what's currently wrong with your design, because thinking of it in the way that you explained it isn't helping me wrap my head around it quickly. Personally, I take that as a sign that I might learn something by digging more, but I can see why others didn't realize it would burn 10 minutes until it had.

3
  • 10
    Can I just point out that I like how this has a TL;DR that's basically telling the OP to make a TL;DR?
    – Davy M
    Commented Aug 30, 2018 at 13:42
  • 16
    Recursion: everyone loves recursion.
    – user50049
    Commented Aug 30, 2018 at 13:51
  • 1
    The question makes it clear that the OP doesn't know if anything is wrong with their design ("Is this an example where it's preferable to break the 'no async wrapper for sync code' rule?"). I don't see how they could explain "what's wrong with their design" if they're not even sure they have a problem. This makes the question open ended and subjective, without having a clear goal in mind.
    – jpmc26
    Commented Aug 30, 2018 at 23:16
7

Several problems come immediately to mind.

  1. There isn't a clear statement of a goal. Your question is a meandering through your own confusion about what you should be doing. This makes the question subjective and open ended. Being in that situation is fine, but pouring that situation out into an SO question typically makes for a poor post on this site.

    On a related but more specific note, you have this rather confusing statement in the middle of your question:

    ...many of them long-running CPU-bound operations (because the API blocks on the database IO).

    My first reaction to this is to question if you know what you're talking about at all. Database IO is not a CPU bound operation; blocking on IO and being CPU bound are mutually exclusive (for a single operation). Perhaps this is just poorly worded, but as a reader trying to understand what you're asking, I have no idea what you're talking about there and think maybe you're confused about what those concepts mean. If you are, this is something you should have looked into and understood a bit more before posting, which would have resulted in a clearer post.

  2. The underlying goal is completely design oriented. It's not about the code as much as it is about the principles of the technology you're using. This is readily apparent just looking at the end of your question:

    Is this an example where it's preferable to break the "no async wrapper for sync code" rule?

    The answer probably won't (or at least doesn't need to) involve code. You could ask the same question about a number of other languages without even involving C#. This immediately suggests it'd probably be a much better fit for Software Engineering, where well-asked questions about design principles and norms find a home.

  3. You've included far too many details.

    In an attempt to narrow it down, you've included a lot of unnecessary details (like you have a "business logic layer into which services are injected as dependencies" and a "data repository service that performs CRUD"). Your question is about an overall design. The real design question is getting lost in this overload of details.

    As a result of all that specificity and those code sample, your question has morphed into something approaching a "Here is my entire code base; you figure it out," question. These are awful to try to read through as an answerer.

    Furthermore, the enormous amount of detail has reduced the usefulness to future readers. It is so detailed that even if you get a good answer, future readers are going to have trouble figuring out whether the advice applies to their situation or not. It's gotten pretty close to falling into the old "too localized" close reason.

To fix it, make your question about the principles and the overall design and ask on SoftwareEngineering.SE instead. This will probably allow you to omit an enormous amount of irrelevant detail and the code samples and instead craft a question that focuses on only the specific elements of your design needed to address the issue of having an asynchronous wrapper. A TL;DR section isn't going to fix this.

2
  • 2
    I also think the confusion of the OP surfaces in describing a CPU-bound task blocked on I/O. By definition, it's either CPU-bound (meaning, the CPU is computing stuff) OR blocked on I/O, unless one uses busy-waiting... which should be made explicit if it is the case. Commented Sep 1, 2018 at 14:01
  • @MatthieuM. Good point. I noted something about it in the answer.
    – jpmc26
    Commented Sep 2, 2018 at 21:18
4

One simple suggestion, and I'm not sure how much difference it would make, but I think it could be helpful:

Try to restructure it a bit so people can see some code earlier;
// (sorry for using a code block for non-code. It's a visual aid ;-) )

If people are judging it quickly as a "wall of text" and downvoting based on that without reading it much (speculation, and I haven't read it myself, to be honest), it may help to break it up if you can; some text, then some code, then some more text. As it is, on my monitor I only see the first couple of lines of code above the fold, and before the edit, I wouldn't have seen any.

I think design is important in writing Q&A, especially if you have a long, complex question like yours. Do as much as you can to make it easier for people to parse it. The more time-consuming it looks, the fewer people who will be willing to do it, and some of the ones who aren't will probably downvote it. Whether or not they should do that is subjective, but of course people are free to vote how they want to, and I assume the reasoning is something like "if I think it's too much to read, then I think it's not useful."

I'm not referring to whether it's on-topic or sufficiently MCVE'd, but assuming it is, I think just making it look less like an essay will make it more likely for people to want to engage with it.

You must log in to answer this question.

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