4
\$\begingroup\$

As a person who joined Stack Overflow about 15 years ago I am always curious to see what new flavours of my favourite Q&A site emerge every year.

So from time to time google takes me to Mathematics, Software Engineering, even Retrocomputing or English Language. And very often I find there intriguing topics, ideas and solutions.

However from time to time google takes me also to Code Review and frankly, I can't get my head around what I'm seeing there:

  • the topic I'm interested in is there, cool
  • then there's usually some mediocre code asking for review
  • whether I understand that code is really 50:50, sometimes it's incredibly hard to follow (as there is no requirement/limit for a minimalist example as on SO for instance)
  • so okay, somehow I made it through the code
  • then there is usually a couple of answers with good tips and hints
  • OP thanks for them
  • the end

So I'm wondering, what is the value of such site? If I'm totally clueless about some topic then perhaps OK, I get at least that mediocre code, better than nothing. However if I'm interested in implementing a specific design pattern or something similar, most likely I get a really bad code to follow / build on because there are no final answers / code posted. Even the official (?) guide doesn't mention this point explicitly: How to get the best value out of Code Review - Asking Questions, it only encourages to do that if it could lead to another code review.

Don't get me wrong, I understand that for OP this may be invaluable help, perhaps the reviewers can train their skill to be better at doing code reviews but... is this really the point of this site? Does it need to be a Q&A site after all? Wouldn't be github with some sort of plugin for the "social part" a better and more natural solution for this kind of activity?

I'm sorry if this sounded too negative, I just really don't get it. There's such a wonderful family of SE sites and then there's CR -- which I have to skip everytime I see it in google results :-/ So maybe someone from local supporters can correct my point of view?

\$\endgroup\$
5
  • 1
    \$\begingroup\$ "However if I'm interested in implementing a specific design pattern or something similar, most likely I get a really bad code to follow / build on because there are no final answers / code posted." That's not what the site is for, so maybe that's what's part of the confusion? \$\endgroup\$
    – Mast Mod
    Apr 13 at 20:36
  • 2
    \$\begingroup\$ For me, CR is not about the destination. It's about the process of getting there. If someone else feels they can tag along and learn something from that process, that's great too. \$\endgroup\$
    – Mast Mod
    Apr 13 at 20:38
  • 3
    \$\begingroup\$ And yes, CR does not fit 100% within the Q&A structure of the SE sites. It took some doing to get a review site working within that framework, but it seems to work for enough people. \$\endgroup\$
    – Mast Mod
    Apr 13 at 20:38
  • \$\begingroup\$ By no means I wanted to imply that I'm a role model of an ideal SO user. :-) I'm mostly a passive observer. But @Mast and the guys below have a valid point - maybe I shouldn't look at CR as another Q&A site in mind, i.e. it is more about the learning process for both sides. Haven't thought of that this way. \$\endgroup\$ Apr 14 at 7:02
  • \$\begingroup\$ Very related: codereview.meta.stackexchange.com/q/8919/37660 \$\endgroup\$
    – Vogel612
    Apr 27 at 15:47

3 Answers 3

5
\$\begingroup\$

I have been involved with code reviews and design reviews for more than 33 years. One of the major reasons to have a code review in a professional software development environment is for teaching purposes. You team 2 or 3 more experienced developers with 2 or 3 less experienced developers (new hires with less than 2 to 3 years of development experience). This is how major companies improve the talent working for them. There has been a lot of research done on code reviews, it has been found that each bug that took an hour to find in a code review would have taken 55 hours to find in a debug session of production code (the Software Engineering Institute at Carnegie Mellon University).

If the Code Review community had no value to anyone other than the OP, would any of our questions get more than a few views? Of the 28 questions I have asked 5 have more than 1K views (one has 7K views), and 3 more are over 500 views. Many of the 485 questions I have answered have over 1K views within the first 2 days. This indicates that users besides the OP are getting a benefit from the questions and answers.

Some of the most popular questions I have seen have to do with tough subjects like multi-threaded code. Many people get this wrong and need help. Some other popular questions are games.

Many times I have found ways to practice coding by trying to implement a solution to one of the questions. In some cases this has led to writing more than 5,000 lines of code.

  • then there's usually some mediocre code asking for review

The whole point of this site is to help people improve their coding skills. Of course there is some mediocre code. In some cases there is really bad code, as long as the code does what is intended, we will attempt to help the OP. For new programmers they can see what not to do with the tips and hints.

  • whether I understand that code is really 50:50, sometimes it's incredibly hard to follow (as there is no requirement/limit for a minimalist example as on SO for instance)

This point makes me think that you have never needed to maintain someone else's code on a major project. I've had to add features and debug code in a code base of more than 10,000 lines of code that 2 or more other programmers wrote. I don't see the problem with not limiting the code to the minimum necessary to reproduce the problem. For improving people's coding ability we need to see more code to understand that code.

  • OP thanks for them

Actually we discourage this.

  • the end

In many cases this isn't the end, the OP or another user will ask questions about the tips and hints in the answers. In many cases the OP will post follow up questions with improved code that they want reviewed. This allows everyone to see how to improve the code.

There are projects on GitHub, GitLab and Bitbucket that do go through code reviews but these projects are open source projects with many users involved. Beginners may not have anyone to review their code, especially if they are self teaching / self learning. Other users do learn from posted mistakes.

\$\endgroup\$
1
  • \$\begingroup\$ The point was probably if it is more than a help desk (all posts could be automatically deleted after two months without any ill effects). \$\endgroup\$ May 30 at 3:13
5
\$\begingroup\$

I think you're coming at Code Review from the wrong angle.

Let's pretend Code Review were a Reddit community; you likely wouldn't assume the site is going to help you. Because Reddit is largely a social media site. With content ranging from the far left to alt-right, from cat to dog pictures, and a sprinkling of tech. That's not to say social media sites are unhelpful. I'm personally thankful some of the communities have developed 'for noob install instruction' threads which I've used.

For a short period I posted a few answers on the Python subreddit which help users. Now, if you came across the posts you'd likely have the same "what's the value" response. As the posts were really poor, and would likely be closed on Stack Overflow.

Now here's the thing. Personally I've found most Reddit posts to be unhelpful. So when I see a Reddit post as a search result I don't click on it. I also assume all sites I've not used before to be similarly unhelpful and use them as a last resort.

But I'm sure you already knew this.

Does it need to be a Q&A site after all? Wouldn't be github with some sort of plugin for the "social part" a better and more natural solution for this kind of activity?

So I'm not sure why you'd bring it up.

There's such a wonderful family of SE sites and then there's CR -- which I have to skip everytime I see it in google results


So I'm wondering, what is the value of such site?

You've indicated some ways the site has value:

  • then there is usually a couple of answers with good tips and hints

...

If I'm totally clueless about some topic then perhaps OK, I get at least that mediocre code, better than nothing. However if I'm interested in implementing a specific design pattern or something similar, most likely I get a really bad code to follow / build on because there are no final answers / code posted.

... I understand that for OP this may be invaluable help, perhaps the reviewers can train their skill to be better at doing code reviews ...

You have conceded Code Review has value to others. And the specific part you find of value and are looking for is; "I get a really bad code to follow / build on".

Now, all user contributions on all Stack Exchange sites are licensed under various versions of the CC BY-SA license. When a person copies or creates a derivative of the post then the content has to follow the terms of the license. Two big parts of the license are attribution and copy left - all derivatives must be the same/similar license.

Let's take the situation when an uninformed internet searcher is looking for some code. The searcher goes on Code Review and gets a chunk of code to build on. The searcher neglects to follow the terms of the license (who attributes SE posts?). And as such the searcher has committed copyright infringement.

Code Review's focus has been the bit you've minimised as "tips and hints". If we focus on the content you value then we create a worse experience for all.

The second Code Review gets an active 'copyright troll' no-one would want to copy from 'use' Code Review again.

\$\endgroup\$
0
2
\$\begingroup\$

Concurring with the other answers, and also:

what is the value of such site?

To a certain extent, the value of this site is the same as the idealized value of other sites in Stack Exchange - referential value. Editing questions for clarity, editing answers for clarity, and community wiki answers are all encouraged - and there's a site search for existing questions - all in the name of offering value to a person seeking reference to solved problems. The kind of solved problem is very different here from that of Stack Overflow - there, it's "why is this specific program not working" and typically has one specific, fairly focused answer. Here it's "in this program, what best practices can be applied to improve it".

By way of example, let's say I'm a well-meaning user wanting to write a password generator in Python. A good first step (albeit perhaps not one that enough beginners apply) is to effectively do a literature review and see how people have attempted to solve the problem. In such a situation, Code Review IMO offers much more value than Stack Overflow, as it illustrates the common pitfalls that people encounter when writing such an application - and design pitfalls, unlike breaking errors, are often invisible to the OP.

\$\endgroup\$

You must log in to answer this question.

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