How to Submit a Code Snippet for Explanation or Review?
Focus the scope to differentiate between code observation and execution conclusions in the response.
Limit the Code Scope
First provide the function or relevant snippet to be reviewed, specifying the language, invocation method, and expected behavior. If the issue depends on configuration, input format, or other functions, include the minimal necessary context. Clearly state whether you want to understand control flow, boundary conditions, or potential issues to avoid the response expanding into a generic checklist for the entire project.
Provide Specific Review Objectives
You can write "Explain how this function handles empty input and point out boundary cases that need testing." If you want modification suggestions, request explanations of the reasons and expected impact. When pasting code directly or providing it via available attachments, always check indentation and file names; do not include real keys or secrets in the materials for convenience.
- Provide the relevant code, language, and expected results.
- Describe the actual behavior or the most concerning risks.
- Request that findings, suggestions, and verification methods be listed separately.
Confirm Which Review Steps Have Been Completed
Conclusions drawn solely from reading code constitute static analysis and do not mean tests have been executed. If the response claims the program was run, check for corresponding tool outputs; if the environment is unavailable, ask for a list of unverified parts. Before adopting modifications, behavior should still be checked in an appropriate environment, especially ensuring both normal input and error handling meet expectations.