This website seems particularly interesting for users working on a book (like SICP or K&R) or any other series of exercises (like ProjectEuler), especially if they're working on their own and would like feedback for the code they wrote.

I am often tempted to post each and every solution I write for these exercises, but before I do there are two points that prevent me from doing it:


I work on these exercises at a rate close to one solution a day. If the past 3 months are of any indication, I will have posted around 100 new questions by the end of the year. I understand that not all exercises are fit for the Q&A format of the website, but we're still talking about a high amount of questions.

In theory, I don't think that it's a bad thing to populate the website with more code to review, however general Web etiquette frowns upon anything that could be seen as spam. In doubt, I'd rather take your opinion before moving on.


I'm not going to be the only one working on SICP or Project Euler (or any other) and duplicate answers to the same exercise are bound to appear. I understand that reading existing questions before posting my own is common courtesy (and the tagging system seems to work well that way), but still that's not giving feedback on my particular piece of code, on the particular angle I'm interested in. Furthermore, as I progress in these tracks, exercises are becoming more difficult and possible solutions are getting more varied.

Generally speaking how are duplicate answers to similar exercises treated on this website?


It is likely that a review of one piece of code by a programmer will turn up issues that are found throughout the work of that programmer.

So if you post several pieces of code in quick succession, it is likely that a common set of issues will be found several times over. It will be more productive if you post one piece of code, receive feedback, and make improvements based on that feedback, before posting your next piece of code.

In the case of Project Euler, it's the algorithms that are most important, and the particular expression of those algorithms (which is what you are most likely to receive feedback on here) is not such a big deal. Project Euler is about finding the answer, not so much about producing clear and maintainable code. So you should take advantage of Project Euler's own solution forum: when you solve a problem, you get access to a forum thread in which other solvers have posted their own code. You should read through the code that people have posted, and adopt the good ideas you find there, especially if they contain insights that you missed. (Then if you are still dissatisfied, you can post your code for review here, of course.)


You must log in to answer this question.

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