What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 122 Stack Exchange communities.

Stack Overflow is more than anything else a place to ask programming questions, but we also have stuff like tips and tricks, code golf (to the chagrin of some), programming as a profession style questions, programming jokes, books, blogs, etc, etc...

I've also seen, and myself placed, problematic code and/or code with unconventional ideas to be viewed by others on Stack Overflow and get help and or opinions about the snippets... in a way a code review of sorts.

So I was wondering how do the rest of you feel about Stack Overflow as a place for simple code reviews (barring placing illegal code). Is this an activity that is in line with the purpose of Stack Overflow or not?

Note: My opinion is Stack Overflow is great for small code reviews of personal projects and such.

share|improve this question
add comment

migrated from stackoverflow.com Nov 4 '09 at 11:51

This question came from our site for professional and enthusiast programmers.

9 Answers

I think it depends on a case-by-base basis. If you just put code up and ask if it's OK, I think there is a fine line you can cross into the realm of "not asking a programming question."

On the other hand, if you have code that you are "unsure of" or think there is possibly something wrong with, then post it and see if others can spot the problems.

share|improve this answer
add comment

Yes, why not. "Is my code good" is a programming question. And I am sure you would receive lots of answers.

share|improve this answer
    
That's a great way to phrase it. +1 –  John MacIntyre Mar 6 '09 at 3:53
2  
"Is my code good?" is a subjective question, and "lots of answers" suggests that there is no answer we can agree on. That makes it less suitable for SO. –  David Thornley Nov 4 '09 at 17:52
add comment

I would say absolutely but within reason. I can't really see anyone willing to spend large amounts of their time code reviewing entire projects.

share|improve this answer
add comment

It's a great idea, unless you're employed. Don't post company-owned code without express permission! And make sure any sensitive information is removed or replaced. You could get into real trouble if your boss finds company source code floating about on the web.

share|improve this answer
    
This is THE very important caveat for code-reviews I'd say –  Robert Gould Mar 6 '09 at 3:43
5  
+1. By posting code you are publishing it under the "creative commons" licence. creativecommons.org/licenses/by-sa/2.5 –  MarkJ Nov 4 '09 at 17:22
add comment

It depends which portion of the voting population is online at the time. :P

share|improve this answer
    
Yeah that's my feeling too. That's why I'm asking to accumulate a more or less consensus on the topic –  Robert Gould Mar 6 '09 at 3:44
    
There are about 45,000 users on SO and you expect some sort of consensus. What a happy little world we live in :-) –  paxdiablo Mar 6 '09 at 3:49
    
You have no idea what I'm expecting ;) –  Spencer Ruport Mar 6 '09 at 4:03
    
Bravo! Nicely put! –  ldigas Mar 6 '09 at 4:16
add comment

As usual, "it depends" -

No

  • If you just want someone to bench-check your widget class before you check it into VSS and clock out for the day, ask a co-worker.
  • If you want someone to double-check your homework before you turn it in, ask a fellow student.

Yes

  • If you're having a problem with your code, yes - post it, describe the problem, and we'll all learn something.
  • If you've discovered the solution to a problem, post the question and your code as the answer, and we'll all learn something.

So in general, I'd have to say "No, SO is not a free code-reviewing service".

share|improve this answer
add comment

I don't mind - I'll vote yes. Most people here are pretty responsible with what they ask/post.

share|improve this answer
add comment

No. I've seen people do it, but it makes me uncomfortable.

As I understand it, SO was envisioned as a repository of software knowledge, where all the good questions get asked, and all the good answers get saved, and anyone with the same questions can find those good answers later.

These kind of "one-off" questions are too specific to contribute much to the knowledge base. Who else is going to have that exact problem later? Questions should be general enough to be useful to someone else, not just you.

share|improve this answer
    
But with proper tagging these "Patterns" and snippets would probably help others. However 10% of me feels the same as you that's why I'm asking :) –  Robert Gould Mar 6 '09 at 4:33
    
It might, but then you get people asking about errors in code that are so elementary that anyone with the same question probably doesn't know the domain well enough yet to know how to search for the answer. :o/ –  Amanda S Mar 6 '09 at 4:56
add comment

There is a new SE site specifically dedicated to sharing working code for peer review: Code Review (Beta)

share|improve this answer
add comment

You must log in to answer this question.

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