I'm still in the process of figuring out many aspects of stackexchange, and a recent question of mine got closed after I responded to comments provided. I'm hoping to understand more about the feedback provided in the closed dialog so I'm posting here.

Here's the original post. And I found almost the exact same type of question for the python programming language from 6 years ago that has been upvoted and accepted in the community: upvoted post. The closure message at the top is labeled 'off topic' and then (here's the part I'm confused about) a tag about "authorship of code is provided here.

I'd love to understand a bit about where this question went wrong in terms of being outside the bounds of code review's posting requirements, and how the "authorship of code" principle was violated in my case? Thanks!

  • \$\begingroup\$ not line for line in any way. Perhaps, that's what confused the moderators? The chapter was about making duck objects, but their code was in Java a language that allows for interfaces, so I was fumbling using javascript which doesn't require them. Thanks for assisting! \$\endgroup\$
    – Li Brary
    Commented Feb 13, 2020 at 18:31
  • \$\begingroup\$ Old posts may have been posted under old policy, please don't use those as example. Especially that old. \$\endgroup\$
    – Mast Mod
    Commented Feb 13, 2020 at 18:47
  • \$\begingroup\$ @Mast gotcha! good to know \$\endgroup\$
    – Li Brary
    Commented Feb 13, 2020 at 18:48
  • \$\begingroup\$ If you could alleviate some of the concerns, perhaps reopening would be more constructive than guessing at what the reviewers thought was intolerable about your question. I can make a couple of guesses as to why it could be considered off-topic, but it's a bit of a grey area and I don't like guesswork. \$\endgroup\$
    – Mast Mod
    Commented Feb 13, 2020 at 20:06

1 Answer 1


The way Stack Exchange works is that volunteers get reputation, and when a user gets 3000 reputation they can vote to close questions. These moderators are different than elected moderators, who have diamonds displayed next to their names.

Your question was deemed to violate the following rule by 3-5 users.

Authorship of code: Since Code Review is a community where programmers improve their skills through peer review, we require that the code be posted by an author or maintainer of the code, that the code be embedded directly, and that the poster know why the code is written the way it is.

This one rule actually has three independent but linked rules within it:

  1. we require that the code be posted by an author or maintainer of the code

    In this case it is debatable who the author is. However you are a maintainer.

    In this situation the closers may have assumed you were neither; instead you just took the code from the book.

  2. that the code be embedded directly

    You have included the code. It is not this reason.

  3. the poster know why the code is written the way it is

    Some closers may have thought you were asking how the code works. A segment of your question can read as a if you're trying to circumvent the rules.

    Does the code below program correctly to interfaces, encapsulate changeable behavior, and employ composition in a reasonable manner?

    If the code does work as intended, the interfaces, etc., are correct then we would answer the question with "yes". But it doesn't stop there; since we're just random people on the internet we should provide proof that we are correct. And so we would be explaining how or why the code is correctly applying interfaces, etc.

So from my perspective I can see potentially two reasons to close your question for this reason. But let's look at another close reason too, as some may have voted to close for this too.

Missing Review Context: Code Review requires concrete code from a project, with enough code and / or context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site.

  1. Linking to:

    If your code was deemed to be example code, too hypothetical to be meaningfully reviewed, then we need you to provide concrete details.

    Your code doesn't really do much. It creates two objects which in some convoluted way add "I'm flying" and "not flying" to the page. I can see people voting to close your question for this reason.

  2. generic best practices are outside the scope of this site.

    Your question could also be thought of as a generic best practice as all you've implemented is a design pattern.

So to summarize, you post has as far as I can see three potential problems:

  • It's not clear whether you're an author or maintainer.
  • It may look like you're trying to circumvent our rules.
  • Your post looks like example code / generic best practice.

In my opinion, your post was:

  1. At the least, closed for the wrong reason.

    I've read the first chapter, and whilst I can see similarities, the code is your own.

    I also think it's rude of us to assume that you're trying to circumvent the rules.

  2. I don't think your question is off-topic for MRC either.

    I'm used to a higher code density, and your code gives off a hint that it's example code.

    But I do think the question is answerable, there's enough context to answer this.

  • 1
    \$\begingroup\$ Granted 2012-2013 is pretty far back, but 1, 2, 3, 4 and I bet a thousand other design-patterns posts use similar example-ish code too. I don't see anything inherently wrong with the OP's question, reopened. \$\endgroup\$ Commented Feb 13, 2020 at 20:40
  • 2
    \$\begingroup\$ @MathieuGuindon Honestly a lot of the design-patterns questions aren't that well-suited for the site because they focus on hypothetical scenario's that are too hypothetical. A programming-challenge is the middle road between a real problem and a text-book example showcasing a new theory/feature/function/library/whatever and a design-patterns post often enough takes a wrong turn in that regard. \$\endgroup\$
    – Mast Mod
    Commented Feb 13, 2020 at 20:44
  • \$\begingroup\$ "deemed to violate the following rule by 3-5 users" 5, their names are in the revision history. \$\endgroup\$
    – Mast Mod
    Commented Feb 13, 2020 at 20:46
  • \$\begingroup\$ @Mast The new close notification allocates all 5 votes to one reason, even if there were a 3/2 split. Where the old notification showed both close reasons. \$\endgroup\$
    – Peilonrayz Mod
    Commented Feb 13, 2020 at 20:47
  • 2
    \$\begingroup\$ @Mast yes, and some of these names ring a particular "check twice before backing that close vote" bell. \$\endgroup\$ Commented Feb 13, 2020 at 20:48
  • \$\begingroup\$ @MathieuGuindon Absolutely, it's a good thing all community moderation can be reversed by the rest of the community. \$\endgroup\$
    – Mast Mod
    Commented Feb 13, 2020 at 20:50
  • \$\begingroup\$ @MathieuGuindon When answering I was trying to find any reason to close the question, and honestly it was difficult to answer because everything felt like I was grasping at straws. I feel I've achieved my goal of showing any way those users may have thought the question was off-topic. AFAIK example code isn't off-topic, and is just confusing way of saying missing context. \$\endgroup\$
    – Peilonrayz Mod
    Commented Feb 13, 2020 at 20:52
  • \$\begingroup\$ @Peilonrayz example code is sort-of off-topic, but example projects is for sure not off-topic. I'd consider this an example project and perfectly on-topic. \$\endgroup\$ Commented Feb 13, 2020 at 21:29

You must log in to answer this question.

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