21

I have my 'pet theory' about Code Review. This is my personal theory, and it is about human psychology, so you will have to take it with some salt..... It goes like this: You post code for review, and... noone knows how good you are as a programmer they do one of two things: find the most glaring problems in your code, and identify what they think will ...


19

There is a 30k character limit to post questions on all Stack Exchange sites; Code Review's is over 65K. If it fits into one question, then you may absolutely ask it. Otherwise, perhaps you will find a way to split it up into two questions, or ask about a particular part in your application. For applications of this site however, it is very important that ...


19

There is no requirement for a Code Review answer to critique every part of the code exhaustively. If a question contains a lot of code, some possible responses might be: Ask for clarification in a comment. If the question is just a huge code dump with no context, I think it might be fair to suggest that the author improve the question. (In general, I ...


18

As a counterpoint, here are a list of highly ranked, small-code questions that have high quality answers, and are generally successful: Each element is the sum of itself with the next element of a List: now do this point-free in Haskell https://codereview.stackexchange.com/questions/25905 Implementing a Singleton pattern in C# https://codereview....


18

Strictly speaking, Code Review requires you to post real code from a project that you are working on. In practical terms, though, any plausible realistic code is acceptable too. If your real project is a shopping cart for a porn site, and you decide to post the question as a shopping cart for a clothing site, that's fine. Just make sure that the code ...


16

I'd do it in small pieces. Firstly post the most important part of your application then wait for a few reviews. If somebody points out a bad practice and it exists in other parts of the application try to fix it before you post the next piece. It could be boring to see the same issues over and over.


15

The code that you want to have reviewed should be included. There are several questions on Code Review containing a whole lot of code, I myself tend to have very much code in my questions, and it's OK to have a lot of code in your question. The only limit is the limit built into the StackExchange system, 65k characters per post. (Be aware though that having ...


14

Should questions like this be closed as off-topic? No, questions like that are reviewable... I find that some of the shortest code samples contain large amounts of wrong. For this particular example I found that: There is no point in creating an anonymous function here, do function highlight_if_no_val() In fact, use lowerCamelCase; highlight_if_no_val -> ...


13

Summarizing some chat, and other perspectives. Also providing more context than the 'counterpoint' answer I gave previously. The 'Real Issues' There are three issues at hand... is there a threshold of 'enough' reviewable content? (and then, an obvious follow-up question is how-much is needed, and how is it measured...?) whether questions like this add ...


13

The size of the post should not be a major consideration. We've had questions about everything from one-liners up to the 64 kB limit. Rather, the issue is whether there is unity in the question — a unifying theme that is more substantial than whether they are all problems from Project Euler or from CS123 Problem Set 9. Namely, the criteria should be: Is ...


13

Your code is average, maybe a bit on the large size, nothing that I'd not answer. Your problem is I see a wall with code, text, some lists, more text, more code, more text, more code and then 'how can I improve my code'. I instinctively just go "No." press back and don't think twice about it. Someone else can answer, I'm not going near that. It's harsh I ...


12

It depends. Remember that reviewers are not paid to review your code, so write out your post, then sit back and look at the preview before hitting that Post Question button. Put yourself in the reviewers' shoes. Would you review this? If you feel it's too much, it probably is. There's nothing wrong with breaking it down into multiple questions. I haven't ...


12

I think our policy is that you are allowed to post as much code as you want, so long as it fits in the question. You are encouraged to narrow the focus of your code in the interest of getting better answers. So it's helpful if you only post the snippets you really want a review of, but its not required. You'll get better answers if you only post the smaller ...


11

Is there a "magic number" of LOC for a simple project that is working, given that I want a "superficial" / coding style review? We don't enforce any maximum length for code samples. The only rule is that all the relevant code should be contained in the question directly (as opposed to posted on a pastebin for example). If you post excessively long code ...


11

There is no actual limit for posted code, aside from a few limiting factors: Character Limit. All SE-Posts are limited to 30k characters (including markdown) Contrary to the usual network-wide restriction of posts to 30k characters, Code Review supports a whopping 65k characters for all posts Description. It is considered good practice to describe what your ...


11

That is sort of hard to determine. We don't get very many large projects that cannot be split up. You may browse code-length if you'd like, or you may post your question anyway and we'll determine if it's too long (or possibly if an automatic flag is raised). The worst that can happen is that it'll attract little attention, but such questions in and of ...


11

I concur, and agree with its reopening. If you don't have anything to say about the code, you don't have to review it. If you don't like the question, you are free to downvote according to your conscience. If you feel strongly enough about it, you might even vote to close it as "Unclear what you are asking". Personally, I think it's somewhere between "...


11

No, it wouldn't be ok. Your question would get closed quite quickly, with a dedicated close reason, stating: Questions must include the code to be reviewed. Links to code hosted on third-party sites are permissible, but the most relevant excerpts must be embedded in the question itself. Only the code that's embedded in the post is reviewable. Link to ...


10

One thing you can do is to remove the heading at the top of the first code block. It doesn't add anything further to the question, so it can be safely removed. Basically, anything that we don't need to know to conduct a review can be removed, and of course you can keep everything in your local copy. If that's still not enough or there is nothing to remove,...


9

We don't have any limits to how much code you are allowed to post. The more code you provide, the more description of the code should accompany it. Be aware though that there are two limits that you need to be aware of: The code you want to have reviewed must be contained within the question itself There is a limit of 65536 characters in a Code Review post....


8

Post the relevant code you want reviewed and include a link to the GitHub repository. You may include additional code you don't want reviewed, if you think it will help reviewers (for example, it might be easier than reading two tabs in parallel). In that case, indicate clearly the parts you don't want reviewed. See also similar discussions on this site, ...


8

We had questions here which had only a small amount of code in it but got rather long answers regardless if it stated no question, or only one question, like for instance "How can this be improved regarding performance?". I don't see a problem having multiple questions in a post if they belong together targeting one "problem", but if it comes to ...


8

As a general rule, we prefer to see: Your full code, unedited, exactly as it appears in your IDE. Code Review has an extended 65,535 character limit. Unless you're getting close to exceeding that, your code isn't too long. With code split across multiple files, it is generally best to use separate code blocks in your question, with a title for each so ...


8

If your code is not working as intended, you should not ask about how to fix it on Code Review. Such a question would be considered off-topic. Assuming that your code does work as intended, you still need to post the code to be reviewed directly in the question. You may optionally add links to external sites (such as GitHub) as a supplement. The size limit ...


7

The only hard limit is the 65,536 character limit that Stack Exchange imposes on all questions. That certainly is a lot of code, and while you could post it all (I've posted a huge question or two myself), you're likely to get better reviews if you post only the code that you think could be better. Of course, you could take the size of your base class as a ...


7

You could try to reduce the character count by reindenting using tabs instead of spaces. However, step back and think about why the 64 kiB limit exists. You could consider it a kind of commentary on your question. What volunteer, working for fake Internet points, would want to read such a long question? Furthermore, would the question be too broad to be ...


7

I think these questions invite low-quality, short, code-only answers and decrease the overall quality of questions on the site. They are too narrowed down on a specific issue and leave very few possible answers, and can be answered with a mere comment. I think the ought to be closed, ideally with a "too narrow" close reason. I have forked @rolfl's query ...


7

The length of the code is actually not important. A short question can contain reviewable code. int main() { for(int i=0; i<=100000000000; i++); // <----- note that the loop doesn't do anything return 0; } We know what the author is trying to accomplish with this code. It accomplishes the intended task poorly, and we can say exactly why. That ...


7

What @200_success said. For the particular post in question, I just started at the top, started critiquing the Naming and, well, never even got past the first Sub before I'd already filled a whole post. That's generally how I tackle those kinds of questions. Start at the start, critique as I go and stop once I've filled a post/run out of time.


7

I don't think that there is anything wrong with your question length. If anything, I would guess that the fact that your questions are written in Clojure is a bigger factor in explaining why they haven't been answered. If you have asked 6 clojure questions and gotten 3 of them answered, that's not too bad. Code Review is a community-run website to improve ...


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