9
\$\begingroup\$

I was wondering if, as part of asking for a review here, can I ask about how useful my code is? That is, getting feedback about what possible use-cases the code I have written has and if people would use it if it were a library.

I would not intend on asking only about the usefulness but of course also looking for general review of the code as a whole, and perhaps also about a specific area of it.

| |
\$\endgroup\$
  • 1
    \$\begingroup\$ Like if I asked if this code is useful? I think nothing forbids asking it as part of your post, but the upvotes you'll get from it can also be an indirect indication. Whatever you do, it's a very subjective matter, what someone deems useful might be overkill/useless to someone else. Who wins? \$\endgroup\$ – Mathieu Guindon Nov 6 '13 at 23:27
  • 1
    \$\begingroup\$ As long as it's related to some use (such as a library) and adequate answers would need to utilize facts (nothing subjecting), then I think it's okay. You could also ask some specific side-questions if you're unsure about certain aspects. \$\endgroup\$ – Jamal Nov 7 '13 at 0:31
11
\$\begingroup\$

I think that both OPs and reviewers should be encouraged to ask about the code's use case. For one thing, knowing the use case helps put the review in the right context. Sometimes code is being written just as an exercise, in which case reinventing the wheel is expected. On the other hand, if the code is intended to go into production, the proper response might be that the entire work should be replaced with a library that already exists.

If the code being reviewed is obviously meant to be called by others, then a review of that code should of course address ways in which it could be made more useful. Even if you didn't ask that question explicitly.

Sometimes I suspect that a piece of code attempts to solve a problem that did not have to be solved in the first place: it's an instance of the XY problem. In such cases, I think it's reasonable to ask the OP to explain the reason for writing the code. After all, the most beautiful, bug-free code in the world is code that doesn't even exist.

| |
\$\endgroup\$

You must log in to answer this question.

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