12

I am curious to see what other people have to say about this. I recently answered the following question:

FOR Loop Gives Last Value in List Each Time

The user got upset with me and took my answer as an insult (although I did not intend for that at all). I guess I could have worded my answer differently, but what I said was correct. The code that was written was inefficient (and everyone does this from time to time, nothing wrong with that). I tried to explain why I said it was inefficient and took time writing code to help prove out my point. I then later added an explanation of exactly what I was talking about to make it clear for the user.

In the pseudo code I wrote, I accidentally included a SOQL query inside a for loop. The user pointed it out to me, but instead of being polite about it, displayed hostility towards me because they had taken offense and downvoted my answer. They then made the following comment:

This does cause a SOQL query for every imported object....You do not need the if(found) clause...seems to be a "truly inefficient" way to do this....

At this point I did get a bit annoyed so I retorted back. In retrospect, I should not have done that. I went back and did what I originally should have done and changed my original upvote to a downvote. I wanted to show the user their behavior was unacceptable, so I changed it.

  • What should I have done differently?
  • How would you have handled this?
  • This site is for future users as well as the person who originally asked the question. Even though my answer didn't specifically address the question (although it did answer it, it just didn't point it out), should I still have posted it?
  • I have always been of the mindset that if you can help improve code, you should. Do you think it is appropriate to sometimes help users if you think their code is going to do something different than they intend?
  • 1
    I'd mostly like to say "kudos to you" for posting about this. I don't think its a case of what you "should" have done differently, but what you "could" have done differently. It appears you're already aware of the essence of what those things are. Being human, we all misread posts at times, mis-type replies or simply make errors of one kind or another. There are also going to be those times when you lead a horse straight to a bucket of water, but its never going to drink!!! That's when I believe trying to remain positive and friendly while giving some encouragement is the best path to follow. – crmprogdev Apr 5 '13 at 1:13
13

People get offended all the time in bulletin boards. I've adapted by always making my posts as factual as possible and trying to avoid criticizing question-askers for being wrong (I'll happily criticize poorly asked questions though :)

In this case, your "truly inefficient" comment and your semi-retaliatory downvote were your contributors to the situation. You could have avoided criticism of the approach altogether and just pointed out a superior solution. In cases like this, where someone is doing something pretty wrong, I usually just go quickly past the cause to the solution: "You're doing X which is causing behavior Y, but you want behavior Z. So change A to B and that should fix it."

That said, even the most diplomatic of people and replies sometimes get into flame wars, and OP's response was unnecessarily sarcastic.

In a forum like SE, where we are truly giving out expert advice for free, I just (sometimes permanently) ignore people who are not thankful or who cross the line in terms of what they expect from me.

If someone asks me to write code for them after my very helpful answer, I just ignore them. If someone posts a sarcastic/snarky comment, I just ignore them and put them on my mental "do not assist" list. If someone calls me on downvoting them (seems to happen more here than on SO), I either ignore them or occasionally explain why if I feel it would be constructive.

There is less than nothing to gain from getting into arguments on technical Q&A boards. In this case, I would have walked away after his comment about "truly inefficient".

One of the things I like about SE is the reputation system. You've got one of the highest scores on this site, and it's very well-deserved. You could have been a bit more diplomatic in this one case, but the OP (a newcomer) could have been too. I'd just walk away, maybe enjoy a self-imposed cooling off period of interacting with this particular user, and keep the good answers coming.

  • 2
    You make a few excellent points. I should have just walked away after the "truly inefficient" comment that was made. My advice was already given at that point and nothing positive came out of the exchange after that. In the future, I will definitely handle this situation differently. – Jesse Altman Mar 26 '13 at 12:03
  • 1
    I liked the "mental do not assist list" point. Very effective for sure :) – Vimal Desai Mar 29 '13 at 18:24
5

The way I handle this on the developerforce boards, the home of truly inefficient code, is to first try to identify and help with the problem the OP has encountered, and then follow up with something like:

However, this isn't the most efficient way to do this, as the combination of x and y means that you will breach governor limits if you are dealing with more than 'n' records at once.

Sometimes I'll preface this with "I'm duty bound to point out" to soften the blow.

The main problem, as others have pointed out, is that its very hard to tell from raw text on a page if the comment is intended in a jocular or sniping fashion. The same goes for people's responses - I jumped down the odd respondees throat when I first started out, only for them to post abject apologies that made me feel terrible. When you throw in the fact that english may be people's second language it just makes it worse.

WRT your comment:

In a forum like SE, where we are truly giving out expert advice for free, I just (sometimes permanently) ignore people who are not thankful or who cross the line in terms of what they expect from me.

surely we should be trying to help these people improve their netiquette rather than just ignoring them?

  • 1
    Yes, we should try to help improve netiquette, otherwise nobody will want to visit the site. – Mike Chale Apr 4 '13 at 12:34
  • 1
    I don't do it liberally, but when I see someone who habitually posts "do my homework for me" type questions, or is rude when asking for follow-up help, I just move on to the next person I can help. I'm not against educating people about netiquette, I just don't do it if the person is way off the mark. I have limited resources and would prefer to use them to help people on technical issues. I TOTALLY support other people helping others on netiquette though! :) – jkraybill Apr 5 '13 at 5:05
4

First, I'm glad you realized the retort did not help anything. Secondly, I agree you should have worded your answer differently; using a phrase such as "truly inefficient" is bound to upset many people.

I would take the tact of giving a clean and simple answer first and then offering an alternative algorithm second. I expect most users would appreciate seeing a more efficient algorithm (I know I do), but nobody wants to feel like they've been explicitly called out. I would just say something to the effect of, "you're doing A, but if you look at B then you might see some gains."

  • 1
    Thanks for the thoughts Mike. You are right that "truly inefficient" was a really poor way to express myself. My main point I wanted to make to the user was that they really need to change what they were doing. My big concern was that any medium to large scale organization is going to hit the 200,000 script limit with the code that way it was originally written. Even worse, I was worried the code would insert duplicate records which from what I could tell from the comments was not the writer's intention. I need to work on my wording for next time. – Jesse Altman Mar 25 '13 at 17:38
  • 3
    I think it was a typical combo of not using the best wording and the complete lack of tone while reading text, it's far too easy to take things the wrong way and for it to escalate quickly. Next time my old advice would be to edit the question to remove a particular phrase if it's been deemed to (inadvertently) cause offence. – Matt Lacey Mar 25 '13 at 23:02
  • 1
    @LaceySnr - Excellent point about the lack of tone while reading text. I hate to say it, but sometimes emoticons can help... ;) – Peter Knolle Mar 26 '13 at 18:16
  • Yeah I tend to abuse emoticons a lot, but it is the best way of ensuring that somebody can tell you're intentions are of a good nature. – Matt Lacey Mar 26 '13 at 22:31

You must log in to answer this question.

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