Is Blender.SE an appropriate place to ask for code review?

Is is OK to post scripts or snippets on Blender.SE for code review?

I'm trying to get up to speed on writing code (mostly Python, but perhaps also some C) which I could release to the Blender community.

I'd like to find out if I've got any habits that need breaking before I get too used to the whole environment.

• Python is still on-topic on Code Review, of course. :)
– Ry-
Jul 6 '13 at 20:56

I will leave it to the concensus of the community to decide the final decision, but IMHO code review could end up leading to extensive discussion, which is not a good fit for this site.

However, code related questions (for example, if a particular section of your python code is not working as expected) are within the scope, so long as they are concise and able to generate a single, good answer.

For more extensive code problems, I would suggest IRC or Blenderartists.

• I was thinking about posting code that works but which may or may not follow best/good practice. Jul 3 '13 at 2:26

Expanding on what RolandiXor said — You can also swing by the site chatrooms, some people who dabble hang there.

I agree with his answer as code review is too wide a subject and can often be seen as non-constructive as more than likely your questions will be extremely localized if not completely out of scope and that defeats the purpose of the site as one of our main goals is to create a compilation of reusable and general answers… answers that can benefit others.

All that being said, you can get away with this at times depending on how you phrase your question, optimizing code, best practices and runtime errors etc. are on-topic but general "what do you think of this snippet" or "how can I rewrite this to be more pythonic" are not ideal questions.

• I actually find critiques of specific examples useful - programmers are typically pretty good at abstracting away from specifics ;) I understand the SE philosophy though.. thanks. Jul 3 '13 at 2:29

I doubt you'll want entire scripts scrutinized, people tend to be more vicious on smaller portions of code. What's the saying? :

Ask a programmer to review 10 lines of code, he'll find 10 issues. Ask him to do 500 lines and he'll say it looks good.

Why get someone else to profile your code? Find your bottle neck (in itself a learning experience) and then ask people if there are better ways to do it, I think blenderSE would be a fine format / place to approach it that way.

No, code review is off topic. Just as "Does my model look good?" is off topic.

The person asking the question needs to take the code they write and formulate a valid question which is more specific.

This will probably mean they have to break up their script into a smaller example, and identify enough of the problem so they can ask a useful question.

Further, we have the patch tracker where we review code for inclusion in blender, bf-python mailing list - for devs to ask general questions about their scripts.