17
\$\begingroup\$

One of the checklist items for an on-topic question is:

Do I want feedback about any or all facets of the code?

I have considered posting old code to CR which I think would spur useful discussion that would be relevant to future visitors of the site. StackOverflow, for example, has many highly rated questions which were not asked because the questioner personally needed the answer.

In regards to the quoted rule of thumb: I would not actually be using this feedback to modify the original code, either because it is not in use anymore, or because its usefulness is dominated by its longstanding correct execution, which is not worth risking for stylistic reasons.

\$\endgroup\$
  • 9
    \$\begingroup\$ You do want the feedback, you're just not going to implement it. I'd say it's perfectly within the rules. \$\endgroup\$ – Jeroen Vannevel Sep 12 '14 at 22:19
  • \$\begingroup\$ Related: What does it take to make code your own? \$\endgroup\$ – 200_success Sep 12 '14 at 22:21
  • \$\begingroup\$ @200_success I certainly didn't intend that to be related. My point was that it's my own code, but offered more as an instructive example than because I am not aware of its particular flaws. \$\endgroup\$ – Ben Jackson Sep 12 '14 at 22:23
  • \$\begingroup\$ I've edited the title — is that closer to what you were wondering? \$\endgroup\$ – 200_success Sep 12 '14 at 22:27
  • 1
    \$\begingroup\$ @200_success It's a better title for the question I wrote. CR's rules position it much more like a forum site than the rest of SX: On other SX sites, questions that are only valuable to the poster are off topic ("too localized"). What I'm trying to get at is whether there's also a place on CR for well-chosen sacrificial code to illustrate particular issues. \$\endgroup\$ – Ben Jackson Sep 12 '14 at 22:49
17
\$\begingroup\$

Good question

The purpose of this phrase:

Do I want feedback about any or all facets of the code?

is specifically because people can ask questions saying 'Please only review the whether this is thread-safe', or something similar. Code Review is not constrained by things like that, and people reviewing the code are free to review any aspect of the code, from the style, through the functionality, including whether it is thread-safe, or whatever.

So, if you only want feedback on a subset of the facets, then you should not be asking on code review. Regardless, you can still point out areas of your code that concern you, but not to the exclusion of anything else.... You can say "I am worried about whether it is thread safe", but cannot say "only review the thread-safety".

As for your question, sure, ask it. The purpose of a code review is not only to improve your specific code, but to also improve you as a programmer. If you can learn something from the review, then whether you apply that to your current code, or some future code, then that's fine.

\$\endgroup\$
  • 1
    \$\begingroup\$ +1 Good Answer! \$\endgroup\$ – Malachi Sep 16 '14 at 13:24
  • \$\begingroup\$ So if I want thread-safety reviewed, should I say "I'm primarily interested in feedback on the thread safety aspects of this code, however all improvements are welcome" or something? Just so people know what my primary objective is? \$\endgroup\$ – corsiKa Sep 17 '14 at 15:31
  • 1
    \$\begingroup\$ @corsiKa - that's a great way of putting it. Many times people will not consider thread safety unless it is specifically pointed out that the code needs to be thread safe. Your wording is just fine. \$\endgroup\$ – rolfl Sep 17 '14 at 15:33
11
\$\begingroup\$

I think it's fine. You are never obligated to implement any changes after a code review. However, out of courtesy, it would be nice if you

  • post code that is plausibly relevant ("Please ignore this known Y2K bug in my code from 1995" would be unreasonable.)
  • keep an open mind to any advice you might receive
  • refrain from asking a series of questions containing flaws already pointed out in previous answers

We might discover a hidden optimization opportunity or security vulnerability. You never know what you might learn unless you ask, so go for it!

\$\endgroup\$

You must log in to answer this question.

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