7

As my reputation shows, I'm been here enough to at least "think" I know what a good question, and a bad question is. I don't, however, ask questions very often at all. In fact, I have 8 questions compared to 1,520 answers.

I've started on a new project, and looking to at least try to understand more of C# than just Parameters.Add, and as with many new people to a language, you get stuck far more often than you don't. Therefore, like many don't, I turned to my trusted favourite search engine, and start putting in my errors, or a short description of the problem I have for similar questions. This, as many of us know, bodes me well.

When I finally did become stuck, without a solution I could, I felt it was time to ask. I'm probably going to need to ask more in the future, so why not now?

The question, however, was met with multiple downvotes without comment, and I am honestly unsure why. I appreciate that different parts of the community look at questions differently (I'm completely a SQL Server person, where 99% of my rep has come from, so I hope I understand that well), but I'm likely to be asking more questions in the C# community in the future.

Therefore, I'd like to know where I went "wrong". I have my attempts, errors, and also shown other methods I tried to use. Does the C# community require more than that to ask a "good" question?

I realise this looks like a question of "High rep, doesn't know how to ask", but I really can't see where I went wrong. I'd like to ask more questions in the future, but if there are nuances to the c# community I don't know, because I spend all my time in the SQL Server community, could someone tell me what those are?

Constructive feedback is most welcome, as without the comments on the question as to why the question was "bad", I am concerned I'll only make those mistakes again.

19
  • "I am shocked that with your such a high reputation you have not seen that your list is defined within the ScriptList class" is likely what's going on. That user has claimed to not have downvoted, but that doesn't mean others didn't feel the same way.
    – Kevin B
    Commented Oct 8, 2019 at 16:19
  • Completely unrelated, that first comment is flaggable (and it's now gone too). The second one is NLN, same with the third one (yours) now that the first one is gone. Commented Oct 8, 2019 at 16:19
  • 1
    I did flag that first comment.
    – Thom A
    Commented Oct 8, 2019 at 16:20
  • 2
    I don't think your question is bad, but there are a couple phrases you use that tend to crop up in bad questions, and possibly someone over-zealously thought your question was like the numerous bad ones that say them: "I've honestly look at a lot of answers here, and every different attempt brings me to a different error" usually is a cop out by people who have only looked at a couple answers, but of course the lack of a duplicate indicates that you have researched well. "However, it simply doesn't" usually indicates a non-descriptive error, but you go on to describe it so it's not an issue.
    – Davy M
    Commented Oct 8, 2019 at 16:24
  • 1
    I would also make sure to have the same amount of opening and closing parentheses...
    – honk
    Commented Oct 8, 2019 at 16:30
  • 3
    Honestly, @DavyM, I'd have been happy with a close with duplicate. Means my searchfu failed me. The lack of any votes for close made me think that some else was wrong.
    – Thom A
    Commented Oct 8, 2019 at 16:57
  • 1
    There's also the fact that this was a rather elementary object oriented programming mistake. Your class had a member that was of a particular type, but your question asked why your class itself didn't act like it was of that particular type. To many who have come up in OOP, that's a standard "is a"/"has a" mix up that is table stakes for an OOP language. I am not saying that is a reasonable reason to downvote, but I've seen people downvote questions that are "obvious" in the eyes of practitioners. Commented Oct 8, 2019 at 17:02
  • 3
    Certainly I've seen downvotes for what can be seen as "obvious", @HereticMonkey , but generally you find those are followed up with close votes for other dups (due to being common misunderstandings) or comments with documentation links (I personally use the latter quite often to try to get the OP to learn themselves),
    – Thom A
    Commented Oct 8, 2019 at 17:43
  • Sure, I often link to the docs myself; not sure why people didn't in this case, or even if this was the reason for any of the downvotes. Just throwing out another possibility. Commented Oct 8, 2019 at 17:48
  • Honestly, Documentation would be great still. :)
    – Thom A
    Commented Oct 8, 2019 at 17:50
  • FWIW ""High rep, doesn't know how to ask"" isn't a bad thing -- I'd much prefer that situation over "High rep, but doesn't know how to ask and doesn't bother trying to learn" :-)
    – TylerH
    Commented Oct 8, 2019 at 18:34
  • Side note, whenever I find myself in your situation, I like to isolate the specific issue from everything else. Dealing with an odd compilation error in the middle of a huge application makes fixing it difficult. Prototype & isolate the code that's failing (the type and the call to Add). Clean things up so that they are concise. Call still failing? Try removing the call, debug, & examine the object at runtime. What properties and methods does it have? Use the quickwatch window to play w/them. Stuff like that helps keep me from asking q's about what essentially is a simple syntax error or bug.
    – user1228
    Commented Oct 8, 2019 at 18:37
  • 1
  • Thanks @HereticMonkey, I greatly appreciate that. I'll have a read this evening. :)
    – Thom A
    Commented Oct 8, 2019 at 18:47
  • @Larnu for addition reading: I would recommend to find a good article that lists standard names for elements of language (I don't see it to be a problem in the linked question, but that's a very common problem with beginner's C# questions) - words like "attribute", "variable", "field", "parameter", "value" … frequently used interchangeably in questions while have very specific meaning in C# (the other set of "method", "function", "procedure", "action" is less confusing but sticking to names used in specification - "method" is generally better)…. Commented Oct 8, 2019 at 19:15

1 Answer 1

9

Here are my reasons why I would downvote if I see that question:

  • lack of MRE
  • "searched alot" text: "I've honestly looked at a lot of answers here"
  • completely unrelated SQL code (with likely spelling "Scropt" error)

I would expect someone who has 2K+ reputation to trim code to just the problem and explain (with possibly separate code) what they want to achieve. While your post provides context, it does not show that the OP spent time narrowing down the problem.

I.e. I'd expect roughly the following as an MRE:

ScriptList list = new ScriptList();
list.Add("test"); // Fails here claiming "ScriptList" class does not have method Add

public class ScriptList
{
   public List<string> ScriptItems {get;set;}
}

Note that this MRE looks very unclear to readers because they will clearly see ScriptList that does not have any methods - so first comment/VTC unclear would request some plausible reasoning why one would believe methods should show up on that class (which is possibly where the real question was).

7
  • 1
    Thanks for your input. Honestly, from my point of view (as someone very new to writing the language) I will admit that I would never be able to come to the conclusion that that is the "required" MRE. It removes a class, and the section of code the error line was in. As someone who is keenly aware of "error on line 31" can often mean "you did this wrong on line 2", this would be very difficult for someone who doesn't know the language to achieve without keen knowledge of the language, would you not say? But then, if I had that knowledge, I wouldn't be asking such a simple question. :)
    – Thom A
    Commented Oct 8, 2019 at 17:57
  • 2
    Do keep in mind it's recommended to avoid language such as "clearly", "simply", "just" (etc.) when explaining things to users (e.g. this MRE looks somewhat stupid because clearly ScriptList does not have any methods) - what might be clear or obvious to you as an expert may be very esoteric or difficult to understand for someone new to a language. Even if you think it's something that should be obvious regardless of language.
    – TylerH
    Commented Oct 8, 2019 at 18:32
  • 2
    @TylerH thanks for feedback. I've edited the sentence to reflect what I wanted to say... Basically it is the problem with such "simple" questions - OPs do not narrow down code they don't understand and when they do it is very hard to people with knowledge of the language to figure out what exactly is unclear there... And even if answer provided there is no edit to the question to clarify what exactly was asked :( Commented Oct 8, 2019 at 18:53
  • 3
    @Larnu Do you believe that post had MRE? In this case it actually would be nice to know why you thought that it is MRE - we constantly have hard time trying to get people to provide one... At very least can explain why you kept all SQL code in the sample (which is my beef with many questions - people post SQL injection code which derails they question completely... at least yours was safe from that point of view) Commented Oct 8, 2019 at 18:59
  • 2
    From my perspective, as someone new to writing C#, yes, @AlexeiLevenkov . Obviously there's more to the application than that, but I left the classes and ScriptList Object (is that the correct word) parts in as I knew it was something to do with those. The reason I left the SQL in is I wasn't in truth as did wonder if something was fundamentally wrong with the way I was communicating with SQL Server. I wanted to ensure that those reading the question also could see that my defintiion of the List and what it contained matched that from the query; in case that can be an issue.
    – Thom A
    Commented Oct 8, 2019 at 19:36
  • 2
    As someone who has all their reputation from SQL Server, and who knows all too well the consequences of it (not personally, but I've dealt with enough people who have suffered it in my time due to either laziness or "innocence") I would expect to be ridiculed if I did have injectable code. :) I agree that questions which display injection very often are derailed, but it is also incredibly sad, and concerning, how common it still is in the industry, and how so many seem to "not care".
    – Thom A
    Commented Oct 8, 2019 at 19:39
  • Yesterday I commented on this answer accidentally instead of the question--I was trying to say that the asker's code was obviously not a MRE, agreeing with you.
    – philipxy
    Commented Oct 10, 2019 at 0:26

You must log in to answer this question.

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