The Stack Overflow podcast is back! Listen to an interview with our new CEO.
44

Upvote for effort I think that it's important to keep in mind what it's like to post to Code Review as a total newcomer. After all, they don't teach you in school how to post a question to Code Review. If a user's first post is… On topic, Includes sufficient context, Has a good title or can easily be given a policy-compliant title, then that means that ...


26

If the question has been answered, you must not edit it in a way that would invalidate the answers; that is not permitted on Code Review. If the question is still unanswered, and the bug is easily fixed, then edit (consider temporarily deleting the question if the edit will take more than a few seconds, e.g. due to testing). If the bug is non-trivial, then ...


23

After editing many posts over time, I've come up with my own checklist for formatting posts: (I'll edit this as more things come to mind) Code Any code must be indented (manually, CTRL+K, or the {} button in the editor), not formatted with <code>/<pre>. These tags often leave extra whitespace, and if used incorrectly, hides syntax-...


23

Voting is personal. Personally I find that upvoting good first posts helps making new users feel welcome, and encourages them with positive reinforcement - however if the post is iffy and it still gets upvoted, the vote reinforces not-so-positive behavior, so one shouldn't upvote just to say "welcome", but "welcome! That's a nice post you got here, we'd like ...


21

For the record, the linked question asks: Is there any better way to do this? I believe that is the question we all want the answer to when posting code here, more or less. Is a question that asks for a complete rewrite of a piece of code is acceptable in Code Review.SE? It depends on how it is asked. If you ask "Can someone please rewrite this code ...


18

I want to address the time-constraint issues. Time has become increasingly precious to me, and an indepth review of complicated code can take a lot of time.... there are answers where I have spent days pondering the review. That sort of time commitment is unreasonable for a site like this. In fairness, I volunteer the time, I learn things as I go, and it's ...


18

This is a common problem on Code Review, as we have plenty of unanswered questions. While you are waiting for a review, and to increase the probability that your question will be answered sooner, there are a couple of things you can do: Improve your question See Simon's guide for asking a good question for several tips on how to improve your question. Be ...


16

Four years later, we now have over a dozen questions on Project Euler #1, including multiple implementations in the more popular languages. We also have hundreds of linked-list questions, many of which solve the same problem. Considering the rule that Code Review answers can cover any or all facets of the code, the threshold for considering two questions ...


16

The same thing we do when someone asks us to optimise a specific section of code: We review any and all facets of the code. I wouldn't strictly say we ignore their comment so much as we're not beholden to their wishes. - @SuperBiasedMan One of the rules of CR is that as long as code is working as expected, we are expected to review any and all facets of ...


15

Obviously, SQL injection is a major source of anxiety among beginner PHP programmers. It doesn't help that the deck is stacked against them: The language makes it easy to do the wrong thing and hard to do the Right Thing. Learn PHP in n Hours books gloss over the subject, and even teach them to do the wrong thing. There are a lot of bad examples out there. ...


14

The problem is more general than just Code Hunt. Given current technology, even sophisticated static code analyzers sometimes misjudge code quality. For example: '100' is a magic number No doubt, static analysis can be a valuable tool to warn programmers of bugs and other code quality concerns. However, there are inevitably situations where ...


14

Regularity in the “Rusty Towel of Mutual understanding” Author: Rolfl (revision 3) | answered This question also went to the Hot Network Questions and into the weekly CR newsletter the week it was posted. I think this was a great title because it's not only eye-catching and intriguing, it actually - believe it or not - says exactly what the post is about, ...


14

"Looks good" is a really hard answer to post. You have to be extraordinarily confident in order to be able to post that. Moreover, if a question is truly up to the standards of Code Review and we really want "Looks good" answers, then every question should have an immediate self-answered "Looks good" answer from the asker. If the asker can't say "Looks ...


13

I agree with parts of the three current answers from @RubberDuck, @Simon André Forsberg, and @Pimgd. Which, if I can summarize... questions get voted on when: Horrible code - I disagree with this one. Horrible code does not get upvotes because it is horrible code. Horrible code tends to follow the Hot Question path though (see later). Interesting question/...


13

NOTE: Wearing my 'I am a Java Programmer' Hat (not my mod hat) Having spent some time recently on Code Hunt, I would actively recommend that people avoid it: Stay Away! This will teach you the wrong things! Code Hunt is unlike other 'challenge' sites I am familiar with, in the sense that it is more about identifying the problem, rather than identifying ...


13

are seemingly arbitrary requirements on implementation on-topic for Code Review or should the asker provide a meaningful reason for these requirements for the question to be acceptable? I think two things is of importance here: Who have those requirements? Is it an assignment from school? Is it defined in some programming-challenge? Is it from an ...


13

I think I have a similar feeling, but it's hard to tell, because your question is full of vague or inaccurate elements. I try to address your and main remarks, but if I misunderstood your main underlying objections then please forgive me. Does Code Review systematically prefer the least important code Maybe you meant easy code? As in, easy to answer ...


13

I could personally try and create more content in a Q&A format but CodeReview.SE does not seem like a site that lends well to people answering their own questions? Funny you mention create more content - that was exactly my CommunityBuilding.SE answer to How do I start an active userbase for a tag in on a question and answer site (like Stack Exchange)? ...


13

To help sweeten the pot, I've offered bounties totalling +400 on three unanswered powershell questions. I've advertised the bounties in the Server Fault chat room. Please help spread the word as well.


13

We actually have a few guides on how to ask good questions: How to get the best value out of Code Review - Asking Questions Checklist for how to write a good Code Review question Simon's Guide for posting a good question How is this site different from Stack Overflow? A guide to Code Review for Stack Overflow users Basically, long story short: Include the ...


12

That means that, basically, the worse the code you submit for review, the more upvotes you'll get, and eventually: the more rep you gather. This is not always true. In many cases, good code also get plenty of upvotes (sorry for taking my own code as example). I think there are three different kinds of questions that get massive up-votes: Horrible code, ...


11

Can you post code that works on one version of a interpreter (ex:Python 2) but not on another (ex:Python 3) Yes, we currently tag questions with python if it runs in a version or both versions of Python. We also tag the question with python-2.7 or python-3.x if it runs in only one of these versions. I am new to this specific Q&A site and I got my rep ...


11

Creating different titles for follow-ups is difficult, so most follow-up questions tend to have very similar titles which is perfectly fine. Some options for naming a follow-up question is: XYZ Program v2 Follow-up to XYZ Program XYZ Program continued XYZ Program - follow-up If you want to be creative, you can try to be creative with your titles for the ...


10

Python Python uses Python Enhancement Proposals (PEPs) to improve Python, ranging from style guides to feature requests. There are linter's for a few of these: PEP 8 -- Style Guide for Python Code. There are both online (pep8online.com) and offline (pycodestyle h) versions for this. PEP 257 (pydocstyle h) -- Docstring Conventions. PEP 484 (mypyh) -- Type ...


10

C / C++ Clang's Static Analyzer, a free static analyzer based on Clang. Coverity, a commercial static analyzer, free for open source developers Cppcheck, an open-source static analyzer CppDepend, a commercial static analyzer based on Clang gcc Website: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html Simply compiling code with -Wall -Wextra -...


10

Who determines what's important? Does Code Review systematically prefer the least important code, and what can we do about it? Yesterday I asked two questions, one was a follow-on from the first. The concepts in the question are very new to me because I am a beginner in the languages/tooling that's used, but, to be clear, the concepts involved, and ...


10

Reducing the size of your program in terms of character-count, and reducing the size of your compiled executable, in byte-count, are different things. This is not the only criteria, but, for example, The two lines of code that follow are probably the same size, when compiled: for (int cursor = 0; cursor < dataLimit; cursor++) { sum += data[cursor]; }...


9

From my own personal experience, finding accurate information regarding SQL injection, and even basic PHP security, is actually quite difficult for the novice. A search on Google can bring the best of tutorials and the worst of home-made blog posts. For the rookie, it all seems to work. I think if we could offer these guys a good resource that stays up-to-...


9

My 2 cents in this is having a piece a code that score 3 stars on Code Hunt doesn't make it good code. Code Hunt is still a game, and not an absolute reference on what is and is not a good piece of code. From what I understand of Code Hunt is that they favorite LOC over anything else (correct me if I'm wrong), so they already start at -1 for me in term of "...


9

VB6 / VBA6 / VBA7 (x86/x64) Rubberduck is a free (beer & speech), open-source add in for the VBE IDE maintained by several members of the vba and c# community here on Code Review. For more info see the rubberduck tag. Features include static code analysis, code metrics, refactoring tools, Smart Indenter, a unit testing framework, and more. Direct ...


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