I have some code (a library) of about 25,000 characters (~1000 lines) that I would like to have reviewed.

I have a test project (Windows project with Windows Forms) for that code. Is it a good idea to give a link to this code?

If it's a good idea, where should I put that code? That code can change and should not be reviewed.


3 Answers 3


25k characters is a large post, but it's well below the maximum of 30k (now 65k) so there should be more than enough room to supply enough plain-English context and "walk" the reader through the code.

You can link to the test code for context; I've linked to the code base at a specific commit on GitHub myself, for additional context - the code that's linked to isn't up for review though, but that's exactly what you're saying you want to do here.

TL;DR: yup, go ahead! :)


Not all code posted in a question is always up for review.

Questions frequently include context code that isn't intended to be reviewed, and the best way to indicate that the code you're providing isn't meant to be part of the review is by using quote blocks like this:

>     func fooBar() -> String {
>         return "fooBar"
>     }

This doesn't show up quite so great on meta, as the code and quote blocks appear to have the same background. On the main site, it puts a yellow-ish background behind the gray code block. We take this as a sign that the code is provided as context only and not intended to be reviewed.

I'd highly recommend taking this approach, as it puts all of the necessary information all on one page.

  • \$\begingroup\$ problem is since the test project is a windows form, the code is more than 50,000 characters, not possible to post it in the question \$\endgroup\$
    – Fredou
    Aug 9, 2015 at 21:20
  • \$\begingroup\$ Well, I'd recommend reconsidering posting it all as one big chunk. meta.codereview.stackexchange.com/questions/2436/… \$\endgroup\$
    – nhgrif
    Aug 9, 2015 at 21:21

You cannot link to the code as an alternative to posting the code in your question. The code that you want reviewed must be embedded in the question. We actually have a close reason specifically for questions that do not contain any code. Links can rot and your question would be of no value to the community if that happened.

I was once told that if the code was too large to be posted here, that was a critique in and of itself. I believe this is true. If you have that much code in a single form, then you likely have some work to do prior to getting it reviewed. Extract some methods and classes before getting it reviewed. If that's not possible, then try to focus in on some particularly gnarly chunk of it that you're having trouble with.

However, if you just want to provide some extra context for the code to be reviewed, external links to other code is perfectly acceptable. We would still have the code under review here.

  • 1
    \$\begingroup\$ this question was to make sure this one was following the guide line; codereview.stackexchange.com/questions/100434/… \$\endgroup\$
    – Fredou
    Aug 10, 2015 at 13:28
  • \$\begingroup\$ @Fredou question looks good to me. The meta was just a bit vague. Wanted to make sure it was clear that the question had to have code. \$\endgroup\$
    – RubberDuck
    Aug 10, 2015 at 14:54

You must log in to answer this question.

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