This question came up this morning on SO, I'm pretty conviced there was exactly the same question yesterday but I could not find the duplicate and gave up looking. What I DID see when searching was a huge number of questions, all pretty much on the same theme:

How do I do something in/from another class

Most of these questions have answers pointing out the specific problem in whatever code has been posted, but clearly the problem goes a bit deeper in most cases, since the asker doesn't understand OO programming, particularly the differences between classes and instances.

Is it enough to answer the specific, local question in these cases? Should the answerer be pointing to an OO programming primer? Do they count as duplicates?

  • By the way, your example only slipped through the quality filter because of the formatting. Otherwise this question would have never entered SO. Oct 11, 2011 at 8:15
  • Re: the specific question, this "[array count] returns 0" or "addObject: not working" kind of a question is indeed a dupe -- there's a lot of them out there, but they're hard to find because the OP doesn't understand what's going on and every one is phrased a little differently (and often poorly-written). Here's three good candidates for "master": stackoverflow.com/questions/7125326 stackoverflow.com/questions/3683761 stackoverflow.com/questions/1827058
    – jscs
    Oct 11, 2011 at 17:11

1 Answer 1


In cases where it's clear that the OP is completely off the right track, you could leave a comment (or, sometimes, even an answer) stating that it's pointless to answer the question because there are so many things wrong with it, and point to an OO programming primer. After that, vote to close as too localized.

Alternatively, if you want to invest the time, write an answer saying that they're getting OO completely wrong, and explain (in as much detail as you're willing to write) what they should do differently.

However, be prepared that there will always be lots of people who are going to unthinkingly answer the specific, local question and a contribution suggesting a course change is often going to be lost among so many "correct" answers. And more often than not, the OP will accept one of them. However, if they are really looking to learn how to do things right (many are!), you're doing them a huge favour this way.

If you see no point in answering the specific question, don't do it; point out what the OP should do differently instead.

  • Given the accept rate and previous questions of the user, I've decided to pass on answering it, especially with your utopia scenario answer above, which is the only type I'd be comfortable giving now we've had this discussion. I think I'd be wasting my time.
    – jrturton
    Oct 12, 2011 at 8:02

You must log in to answer this question.

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