What's not so great
The big ones that I personal find distasteful are #1, 4, and 5. They all come off in slightly different ways, but a unifying factor is that they seem a little . . . condescending? A lot of new users on SO are experienced programmers, a lot of new users on SO are beginner programmers, and a lot are in between. I probably fall into the second group, to be honest. 1.5 languages and two years of programming isn't a whole lot. That makes me appreciate all the more that y'all take time to answer questions on Stack Overflow. But the tone of the message does matter.
“This is becoming a waste of my time and you won’t listen to my advice. What are the supposed benefits of making it so much more complex?”
The second sentence is great. That might be a pretty important question for the structure of the example I've made; simpler and elegant code is something I personally struggle with. Having someone point out that I've overcomplicated code is nice.
The first sentence is terrible. My knee-jerk reaction is "Well, if this is a waste of your time, why are you still here?" I'm serious. Chances are good that you have more important things to do; you're likely a programmer, after all. But if you think trying to help me is a complete waste of your time . . . well, that hurts and sure as heck doesn't make me want to come back and ask another question.
I think a lot of people will see that and think "Yeah, but what if the question was terrible and you didn't follow the rules and you were a bit arrogant" and so on and so forth. Sure. Could be. But I'd much rather have someone constructively point that out to me. I'm a huge fan of second chances for most things (third or fourth chances? eh), and if I'm motivated enough to raise my question quality and ask again, that's great.
Being told you're wasting someone's time is incredible discouraging as a new programmer.
“This error is self explanatory. You need to check…”
Well . . . it might be self-explanatory to you, in the same way that it might seem self-evident to you to use a lambda function somewhere to increase efficiency. But it certainly might not be for me. After all, if the problem was self-explanatory, I wouldn't be here. I'd have fixed the problem half an hour ago and would be debugging the next thing I broke.
I'm fine with reminders that I'm not the most experienced person working with the given language - or any language at all. But what's obvious to you might not be obvious to anyone who's new to programming. Sure, it could be an obvious error for anyone, like using completely wrong and bizarre syntax for a function definition. But it could also be something that you've encountered after years of experience with this sort of thing, and I haven't had those years.
Solution? Cut out the first sentence and expand upon the second (or, more importantly, make it an answer).
“I have already told how you can… If you can’t make it work, you are doing something wrong.”
This one could have been pulled from what I can only imagine is an extremely frustrating situation for both parties. The question asker thinks they're no closer to a solution than they were before because they're being told irrelevant stuff; the commenter thinks they've told the asker exactly what they need to know to solve the problem, and the asker's being dense. Either way, it's annoying for both parties.
But that's not this comment's fault; this comment is the result of that frustration. The second bit suffers from the same issue as the one I discussed before: Yes, I know I'm doing something wrong; that's why I'm asking about it. Maybe I'm just being dense, maybe I'm not. It's hard to tell whether or not the comment's justified; it might well be. It depends on the exact situation. Either way, removing the second sentence might be a good idea.
These are . . . just my opinions, and some people clearly disagree, but keep in mind that they come from someone who hasn't participated much on Stack Overflow, even after coming close many times (dissuaded only when I finally pieced together solutions based on existing questions). I'm probably closer to a new SO user than a lot of people here. Plus, I also have faith in the community, and I believe that most of the people working to make questions better and trying to do good, and care about the person at the other end. So, when reading the above, take that into consideration.
The good ones
To be honest, I don't really see anything wrong with #2 and #3. Both seem really helpful (I mean, they could be better, but they're not bad); they give me a path to use the make my question - and code - a bit better. So, I do disagree with their inclusion here. Moreover, they don't suffer from the condescension issues I pointed out above. Maybe #3 could be improved by linking to the help center page about a Minimal, Complete, and Verifiable Example, and maybe #2's reference to a namespace isn't actually helpful, but they seem to be like they're from someone who's at least trying to help.
A philosophy of comments
A secondary goal I try to set for my comments is to make them welcoming enough that the user will return to the site and post another, hopefully better, question. This goal shouldn't interfere my primary goal of improving the question in some way, but if it can be achieved, I'm gonna go for it. That doesn't mean merely being helpful, but in some ways going a bit above and beyond, such as providing helpful links to the help center and tour, and even starting off the comment with a "Welcome to [sitename]!" I've seen it work a lot in the past, and it's really nice.
If the user in question doesn't return to the site, then we've lost a potential user who could have been a fine addition or an unnecessary detriment. We'll just see more and more poor questions from new users, which nobody likes. But if I can successfully get them to make their questions better and get them to return to the community, then there could be a better question the next time around, and a better one after that, and so on and so forth. That grows the community and, also importantly, should make those who volunteer their time a bit less weary, and hopefully encouraged.
This won't work with everyone. A week or two ago I encountered a user on Worldbuilding who just wouldn't take any feedback at all. I mean, they were ignoring everything helpful anyone said, and they insulted a fair amount of normal users and mods in a short timeframe and mods before we finally stopped them. All of those people were being pretty helpful. I've seen this scenario play out plenty of times before; you just can't do anything about some people.
But . . . we optimize for pearls, not sand, and I try to tailor my comments assuming that the person on the other end will take them to heart. They might not, and things might go pretty poorly from there, but if they do . . . well, I've seen some people generate great content even after fairly shaky starts. Again, that's kinda heartwarming, and makes me want to keep volunteering my time and effort to make our corner of the Internet a better place.