18

The mission of Code Review is to help programmers improve working code. Although A-B comparison questions tend to elicit a different kind of answer and therefore make us feel uncomfortable, they are just another way for programmers to seek help to improve their working code. We should therefore welcome them as Code Review questions, even though they don't ...


11

I'm the author of that particular question, and I just wanted to chime in with my experiences with it. (Sort of a ground-floor perspective, if you will.) Yes, the question as asked was about comparing two particular styles to figure out which was better, which was the lesser of two evils. But the fact was that I had been staring at that particular piece ...


9

We've seen in increase in people interested in which code is better for a certain task, without being interested in a review of the code itself. I think that's a problem. To quote Malachi: I think that a comparative review should be 2 questions, and then the user can take the answers from both and do the comparing on their own. then they can decide what ...


7

To me, such questions are interesting and useful. There's not much difference between saying, "here's my code, is there a better way of doing it" and "here's two pieces of my code, which is the better way of doing it". The poster could of course post both pieces of code in two separate questions, each of which is 'valid' in the narrow sense. But I don't ...


5

I think that we should require users to post their (working) code in two separate questions. Then the user can take the answers they receive from both questions and make a decision themselves on which is going to be a better fit for what they are doing on a larger scale. These questions should be linked, create both questions then edit a link into them ...


4

I have been an outspoken critic of comparative reviews. In my estimation, only one of the alternatives can be considered "real code in a real project". The other alternatives are not being used..... so are not "real". That is a fairly dubious concept though, I admit. My preference, and what I have tried to do recently, is to re-phrase comparative questions ...


4

Your observations are keen, but your understanding of the tag is misplaced. The comparative-review is supposed to be used when the question contains two (or more) alternate implementations of the same code, and the question is "which one is better, and why?" So, your questions are: Aren't many programming problems usually have multiple solutions? Yes, ...


3

While I don't think we should completely remove comparative-review, I do think it might be a good idea to considerably narrow the scope on what's allowed under this tag. Comparative reviews should be written in the same language. While it's not impossible to be sitting on the fence about which language to write your code in, if you're at this point, you're ...


3

I don't like comparative reviews, because they tend to be significantly harder to deal with. With "normal" reviews, your task is to suggest improvements. With comparative reviews, there is an added dimension of the comparison, which can be highly complex. Many times the answer is "neither is good, choose a 3rd way". That's noticeably more effort than other ...


2

The problem with this question is not that it's a comparative review. Let's compare (haha) the current question… Filtering/mapping strategies This is real JavaScript/Lodash code used in a project I'm currently working on, but actually this particular question bothers me quite often regardless of the language. Say, I need to generate some data ...


2

This question has the tag, but the asker didn't really ask for other solutions (basing this on the tag description), he asked for an explanation/review on his current solution. To be precise, he asked for why one of his two solutions was better than the other solution. Admittedly, he wasn't asking which was better, as he already knew that. He did want to ...


2

For me, these questions should be closed as off-topic. They're somewhere in the area of asking about code not yet written, asking for an explanation, and failing to demonstrate a minimal understanding of the code the asker wants us to "review", which itself isn't strictly a close reason, but it certainly goes against the spirit of Code Review, I feel. To ...


2

I'm going to buck the conventional wisdom here and suggest that these questions might not be on topic. Code Reviews happen just before code gets merged in (think GitHub's Pull Request). The code is written. It is complete and has been tested. I certainly wouldn't have two versions of the same method/class in my local repository when submitting a pull ...


1

As long as the code is real (non-example), belongs to the asker, and still involves review, then yes, it is okay to post such questions. In fact, we already have a comparative-review tag for this.


Only top voted, non community-wiki answers of a minimum length are eligible