I was the moderator that deleted your post.
I goofed.
Technical answer: Your post was flagged as 'not an answer'. I did not 'expand' the post, so I didn't see the actual code you posted (in the default view, we only see the first two lines of your answer -- we also don't see whether or not the post was accepted. All we see is the post and the first two lines of the response). Based on what I saw, it appeared to be a comment masquerading as an answer.
I was wrong.
It's been undeleted.
In the future, if you think your post was wrongly deleted, your most immediate step would be to flag the post for undeletion with your reasoning. If you don't get an acceptable answer (or you think we've gone out of our minds), then bring it to meta.
The reason I advocate flagging first is that if everyone who had a post deleted brought their issue to meta, we'd be overrun with posts. I've deleted 134 posts just today. Can you imagine 134 questions if (God forbid) people thought their post shouldn't be deleted?
On Handling Flags
There are a lot of factors that go into handling flags, and hopefully this will explain why there are mistakes (in a perfect world, we wouldn't make mistakes):
Yesterday, there were around 2500 flags in the queue total (over 24 hours).
When I was handling this particular flag, there were around 300 flags in the queue when I started handling flags:
If we assume a moderator spends 10 seconds average looking at a flag, then we can conclude that it would take 50 minutes to handle 300 flags in the queue, if no more flags came in.
300 flags * 10 seconds per flag / 60 seconds in a minute = 50 minutes
That means we'd be spending over 7 hours looking at flags if there were 2500 flags in the queue!
2500 flags * 10 seconds per flag / 60 / 60 = 6.9 hours
If there are 10 active moderators, that's 40 minutes per moderator, per day. That's do-able.
This assumes we don't do the following:
- Expand the post
- visit the page to see the post in context (even if we expand the post, we still only see that post, we don't see it in context to the page)
- elect to leave a comment instead of the default responses (Mark flag helpful, mark flag declined, delete the post, convert post to comment)
That means that if you want moderation that is personal, and advocates a personal response instead of just action, you're talking about adding potentially a minute to each flag. Let's see what that would do:
300 flags * 60 seconds per flag / 60 seconds in minute / 60 minutes in hour = 5 hours
Then handling 2500 flags in a day becomes a task that takes:
2500 flags * 60 seconds per flag / 60 seconds in minute / 60 minutes in hour = 41 hours
That means that it'd take 41 hours collective moderator time per day to handle all the flags in the queue. If we assume 10 active moderators per day, that's still 4.1 hours per moderator, per day. We have 16 moderators. If all the moderators were active, every day, then that's still 2.5 hours per moderator, per day.
If we assume an hourly $150 / hour for developer time, that means that it would cost a moderator $375 dollars a day to moderate Stack Overflow, if we assume every moderator should be fully engaged and communicative.
Put simply, that doesn't scale.
This is why we tend to act on flags rather quickly: There's no way to stay ahead of the rush if we don't. That's also why we make mistakes. If I spent a full minute on every flag, I probably wouldn't make any mistakes.
The solution (of course) is to crowdsource as much as possible. Maybe that means reworking the 'not an answer' flags to go through the 10K queue until it's either deleted or disputed x number of times.