1
\$\begingroup\$

A handful of people seem to have formed the opinion that an example project is exempt from this topicality constraint:

Is it actual code from a project rather than pseudo-code or example code?

The FAQ clearly states example code is off-topic, and this notion of example projects being exempt from the rule seems counter-intuitive. It would be natural to assume that example code includes example projects, making them off-topic.

Questions:

  • What are some possible lines of reasoning that could lead to the idea of example projects not falling under the umbrella of example code? For instance, is it because the FAQ is using an uncommon, unwritten definition of "example code" that somehow excludes example projects?

  • Is posting and reviewing example projects here a constructive activity? Why or why not?

\$\endgroup\$
  • \$\begingroup\$ We have never said anything about "example projects". Could you point to some examples of what you consider "example projects"? \$\endgroup\$ – 200_success Jun 19 '14 at 15:55
  • \$\begingroup\$ @200_success follow the first link in the body of my question, "example project" is mentioned a few times there. \$\endgroup\$ – Dagg Jun 19 '14 at 15:56
4
\$\begingroup\$

Example code lacks context. This is mentioned in @200_success' answer to Why is hypothetical example code off-topic for Code Review?

Example project has created context for the code. The context might have been created just as a learning exercise, but I see nothing wrong with that.

Is posting and reviewing example projects here a constructive activity? Why or why not?

Example projects are meant as learning exercises. Code Review is for learning better ways of doing things. Considering the number of questions with example projects and the number of answers those questions have gotten, I say: Yes, it is absolutely constructive.

I think that if we would treat example projects as off-topic, there would be a lot more off-topic questions. It would do a lot of harm to the site. And where could we possibly draw the line between example project and non-example project? Is a simple FizzBuzz an example project? Is a simple Java Calculator with Swing an example project? It would create just another gray area of Code Review, and that is the last thing we need.

\$\endgroup\$
  • \$\begingroup\$ Do you think that "code lacking context" is the only possible definition for "example code" as used in the FAQ, or could other definitions apply, such as "code created solely for the purpose of illustrating a question?" I would think the definition I just gave would be a much more natural definition for "example code." \$\endgroup\$ – Dagg Jun 19 '14 at 17:06
  • \$\begingroup\$ If you do think "code lacking context" is the only definition for "example code" as used by the FAQ, shouldn't the wording be changed to something along those lines? I don't think the phrase "example code" captures that concept clearly at all. \$\endgroup\$ – Dagg Jun 19 '14 at 17:08
  • \$\begingroup\$ Also, none of the questions you mention in the last paragraph would fall under the definition of "example code" I proposed in the top comment, wouldn't you agree? Only questions like "Alfred" would fall under that definition. \$\endgroup\$ – Dagg Jun 19 '14 at 17:11
  • \$\begingroup\$ @Dagg I agree that the current phrasing needs improvement. At the moment, I currently don't have another definition of it, but there might be other definitions. \$\endgroup\$ – Simon Forsberg Jun 19 '14 at 17:13
  • \$\begingroup\$ Do you think "code created solely for the purpose of illustrating a question" would be a suitable definition for "example code?" If not, why not? \$\endgroup\$ – Dagg Jun 19 '14 at 17:14
  • \$\begingroup\$ @Dagg What is it about Alfred that makes it an example project in your opinion, while FizzBuzz and Swing calculator is not? (more or less a rhetorical question) Again, this shows the problem of determining where the line goes between example project and non-example project. \$\endgroup\$ – Simon Forsberg Jun 19 '14 at 17:15
  • \$\begingroup\$ By the authors own admission in the question itself, it is an example (although his own comments contradict that). Common sense also suggests the code was created to illustrate an implementation of a mediator pattern. What other purpose could that project serve, other than to illustrate a concept? It is not a game, tool, library, or anything of that sort. It's just an example. \$\endgroup\$ – Dagg Jun 19 '14 at 17:16

You must log in to answer this question.

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