views:

501

answers:

6

I didn't see this in the official FAQ, and I'm rather new so I'm not sure of the community conventions.

I am a IT guy trying to learn programming on my own. I don't have access to someone else to look at code that I've written, so I am curious if it is acceptable to the SO community to post code for review?

For example, I'm working through SICP and the K&R book right now, and while I haven't run into any roadblocks yet, I'd like to ensure that I'm not learning bad practices in my little bubble here.

So, what is the community opinion, yes or no?

+1  A: 

It depends whether the community can learn something from your example. For example, if you post something very domain-specific, the answers might not be useful to many people. General-purpose reviews are typically conducted within organizations (mainly due to IPR reasons).

Dmitri Nesteruk
+7  A: 

As far as I can see, questions that sound like "What's wrong with the following code?" or "Am I doing it right?", where you provide some 10-20 lines of code and a short explanation of your issue, are generally well accepted, no matter how deep the question turns out to be.

Federico Ramponi
yes - also posting a bunch of code that doesn't compile would be less useful. even this I would be OK with however, provided it was tagged according to some convention
frankodwyer
Non-compiling...if the code was complete enough and the question included the error messages...there've been cases where the error was not in the code shown. With caution, and in emergency, it could do.
Jonathan Leffler
+2  A: 

I don't think it will be apreciated if you post a huge amount of code for review. But once in a while, a single function won't be a real problem I think.

Gamecat
A: 

I agree with Gamecat that I don't think it appropriate here unless you have a specific question about something wrong with a specific block of code or a question about optimization. However, it sounds like a good idea for a spin-off from SO. Code reviews are important so it seems to me that some form of "open-source" review (pun intended) would be useful.

Mark Brittingham
+1  A: 

You might try a newsgroup, such as comp.lang.c or similar. Be prepared to take replies with a grain of salt, but they're still good resources. Google groups is a good way to manage newsgroup subscriptions and threads.

Again, usenet can be a very strange place, so take replies in stride.

Tim Post
Replies on SO need grains of salt too - sometimes even when accepted. Voting usually sorts it out. (I know of one Q that had an accepted answer with negative votes -- that has since been fixed by virtue of the voting system.)
Jonathan Leffler
+1  A: 

SO is a Q&A site. The idea is that answerer helps not only the asker, but many people what (will) have the same question. For this to work, the question has to be google-able.

So, if you can formulate your question in a way "I have trouble combining this and that feature", it is OK. Next guy who does not understand these features can find your question using those key words. "What the hell is wrong with my code?" is a bad question for the site. Nobody searches for "hell" or "wrong".

buti-oxa