23
\$\begingroup\$

This question came up in regards to my comment on this post.

If somebody has two different approaches for reviewing a piece of code, should they combine them into one answer, or have separate answers?

\$\endgroup\$
0

3 Answers 3

15
\$\begingroup\$

I would say that you should make n posts for n solutions. One solution might be better than another, then everyone has a chance to upvote that specific answer.

\$\endgroup\$
6
  • \$\begingroup\$ I agree with Zolomon. I think it's better for the asker to see a range of different approaches to solve a problem. \$\endgroup\$ Jan 19, 2011 at 21:54
  • \$\begingroup\$ What happens when OP takes your suggestions? Does he modify his post and everyone goes along with new suggestions? Is it time for a new question (with very similar code)? Does he leave the post unchanged, so people can offer small variations of the same ideas over and over? \$\endgroup\$
    – TryPyPy
    Jan 19, 2011 at 23:24
  • 2
    \$\begingroup\$ Soltions? It's code review, it's suggestions for improvements, often. I usually have many separate suggestions... should I split these up in separate answers? I'd end up with 3-4 answers on each post. Sure, might give me points, but... Nyah. \$\endgroup\$ Feb 1, 2011 at 14:11
  • \$\begingroup\$ @LennartRegebro: If you have a chain of solutions that are related I would go with one long answer. But if you are providing solutions from different perspectives (unless you're comparing the two), I'd go with the N-N-suggestion. IMHO. \$\endgroup\$
    – Zolomon
    Feb 1, 2011 at 17:05
  • 6
    \$\begingroup\$ But this is code review. It's not solutions to problems, that's SO. I typically have several completely unrelated improvements. No related chains, no different perspectives. That's what the question is about as far as I can tell. \$\endgroup\$ Feb 2, 2011 at 0:00
  • \$\begingroup\$ @LennartRegebro: I see your point.. I've seen different approaches on how to go about the code review. Some do iterations in their questions. Some leave it be. If there's an interation - then I see both pros and cons with having multiple answers, one per iteration, or one huge post with a iterated suggestions included. I think we need more input on this (at least I do.) \$\endgroup\$
    – Zolomon
    Feb 2, 2011 at 12:30
11
\$\begingroup\$

Only if the suggestions are mutually exclusive.

\$\endgroup\$
8
\$\begingroup\$

Here is a more recent way to look at things (Not saying that the ones from 2 years ago are wrong)

To avoid "Facebook scroller long" answers, it is OK to post multiple answers.

If you want to mention a lot of stuff in your answer (such as coding conventions, variable names, method length, code duplication, use of exceptions, use of public APIs...), it is often more useful to split the answer into multiple answers.

\$\endgroup\$

You must log in to answer this question.

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