Skip to main content
3 of 3
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/

Clarification on how to use generic code snippets?

I recently posted a question in which I purposely only included a specific code snippet: Purposely raising exceptions to use catch

In my original (unedited) question, it had a simple example of actual code that I'm using, with the method names and specific exceptions removed. The intent was to keep my question simple so my question is addressed appropriately). "Best practice" types of questions are not generally acceptable for Stack Overflow, hence why I posted it in Code Review.

Was I truly wrong to try to make my method names and exceptions generic? They had no value to my question and would only serve to confuse respondents. Through giving my method names dummy names for an example scenario -- irrelevant to my scenario -- the downvoter decided that my question was now appropriate, even though this edit added no value to my question.

I've read this site's rules and it does little to clarify the requirements around this type of scenario. If generic best practices don't belong in this site at all, why are specific best practices acceptable? That just allows duplicate questions to be asked with slightly different requirements.

grovesNL
  • 328
  • 1
  • 2