-12

There are users who immediately react like Pavlov's dog the moment they see the command eval (or its like). Before posting my answer, I knew that such user is going to appear, and it turned out that I was right (See the comments). Indeed, there are situations where using such command may be dangerous, but these guys are reacting unconditionally without a bit of thinking. If this was once, I can simply ignore it, but every time I post such answer, I know that there is going to be such reaction. How can I deal with these users who don't have much consideration?

Edit You can also see this in the unconditionally reacted downvotes to this meta question as well as downvotes to my original answer that started to appear after I posted this meta question.

13
  • 2
    Literate them on why you used it
    – Arun A S
    Commented Apr 29, 2015 at 16:10
  • 9
    Here's my 2c: When you're suggesting a methodology that relies on potentially dangerous code, then use a disclaimer. I can see that your example isn't dangerous, but what about a new comer who has decided they'll use your answer where the string is user input? You've not explained how that's a bad idea or given any stipulation on eval. Commented Apr 29, 2015 at 16:21
  • @CarrieKendall The OP simply showed a fixed string. The OP hasn't even mentioned that there is an external user or that the string comes from an unfiltered external input. The OP actually may, or may not, but if you become too wild in imagination, almost anything can be dangerous. Even a simple file open command would be dangerous.
    – sawa
    Commented Apr 29, 2015 at 16:37
  • 11
    Stack Overflow isn't just about solving the problem for OP. It is about being a repository of knowledge. Are you assuming that all people who visit that post with a similar problem will be using a fixed string? You can't guarantee that. Adding a disclaimer that explains why you can use eval in this situation really wouldn't be that hard. I can suggest something if you'd like. Commented Apr 29, 2015 at 16:41
  • Given your question, you don't see to understand what "conditionally" actually means. It means the exact opposite of what you seem to think it means.
    – Servy
    Commented Apr 29, 2015 at 16:46
  • @Carrie Kendall I would rather not feel bad if you kindly edit my answer to add some words in the way you like. I personally don't feel the necessity to bother doing that myself.
    – sawa
    Commented Apr 29, 2015 at 16:51
  • I generally wouldn't go through the trouble of correcting someone's mistake when they don't care about the outcome, but since you're possibly punishing others, I will overlook my knee jerk reaction to let it sit and get downvotes. Commented Apr 29, 2015 at 16:53
  • If you mean to say that they will always take a given action in response to a given stimuli then that would be an unconditional reaction, as it would happen unconditionally. If it's happening conditionally, then it's implying that they are taking context into consideration. Not that you have any indication whatsoever that the users voting on that question, or this question, aren't taking the context into consideration; in fact, given the comments on both, it's quite clear that many are.
    – Servy
    Commented Apr 29, 2015 at 16:53
  • @Servy It seems like I should have used the term "conditioned stimulus" rather than "conditioned reaction". And as you mentioned, I should have used "unconditioned reaction". Thanks for correction.
    – sawa
    Commented Apr 29, 2015 at 16:59
  • @CarrieKendall What do you mean by "possibly punishing others"? Also, "correcting someone's mistake": in my case, it is not a mistake although there may be a room for disclaimer/clarification. My answer is correct.
    – sawa
    Commented Apr 29, 2015 at 17:00
  • 9
    @sawa You don't think it's a mistake. Many of the readers disagree with you and do consider it a mistake. The fact that the answer is correct doesn't mean that it's helpful. Correct answers can be (and yours in fact is) actively harmful.
    – Servy
    Commented Apr 29, 2015 at 17:03
  • @CarrieKendall I appreciate your edit.
    – sawa
    Commented Apr 29, 2015 at 17:06
  • 3
    "I knew that such user is going to appear" - then I simply cannot understand why you wouldn't make the (fairly minimal) effort to address their concerns proactively. "I personally don't feel the necessity to bother doing that myself" - why bother answering at all, then? If you're going to do something, at least do it properly.
    – jonrsharpe
    Commented Apr 29, 2015 at 19:42

1 Answer 1

19

You've got two options.

  • Be explicit as to why you're doing something like this. Right now, all your answer surmises is "I don't think X is a good idea. <code here>", which is more confusing to the passive reader and less intuitive to a more seasoned veteran (why would one want to use eval?).

    A little explanation will go a long way in scenarios like this.

  • Don't worry about it. If you're confident in your answer and that you've delivered your solution as concisely as possible, there's no reason to get your feathers ruffled if one or two users make picking remarks on just the one function.

4
  • Thanks for the answer. You are right. I will go with the second option.
    – sawa
    Commented Apr 29, 2015 at 16:19
  • 4
    I would add that, if you do decide to go with the second option, don't be surprised by downvotes (especially since you self-advertised your answer on meta). Personally, I almost always downvote answers that include potentially dangerous code with no explanation. Commented Apr 29, 2015 at 16:31
  • 3
    I wish this were two answers, so that I could upvote "Be explicit" and downvote "Don't worry about it". Commented Apr 29, 2015 at 16:45
  • 2
    @WayneConrad: I don't necessarily disagree with that sentiment, but we shouldn't take away from a user feeling confident in their answer.
    – Makoto
    Commented Apr 29, 2015 at 16:46

You must log in to answer this question.

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