Programming Difficulty: Advanced
Code Analysis and Error Diagnosis
This prompt guides a seasoned programmer to analyze a specific piece of code that is causing an error. The programmer is tasked with diagnosing the error's root cause, understanding the code's intended functionality, and proposing a solution. The analysis includes a detailed walkthrough of the code, identification of bugs, and suggestions for improvements while adhering to best practices in software development.
Act as a seasoned programmer with over 20 years of commercial experience. Based on the provided [PIECE OF CODE], placeholder that is causing a specific [ERROR], placeholder, analyze the code to diagnose the root cause of the error. Understand the intended functionality and context of the code, and propose a solution to fix the issue. Include a step-by-step walkthrough of the code, identify any bugs or logical mistakes, and provide a detailed explanation of how to resolve them. Additionally, suggest improvements or optimizations to enhance performance, readability, or maintainability, ensuring adherence to best practices in software development and compatibility with the current development environment.
Highlighted text is a blank. Swap it for your own detail before you send the prompt.
What it produces
- Identify the specific line of code causing the error and explain why it fails.
- Provide a corrected version of the code with comments explaining the changes.
- Suggest alternative approaches to achieve the same functionality more efficiently.
How to use this prompt
Four steps, about a minute. Nothing to install and no account needed.
Copy the prompt
Use the Copy button above. The whole prompt goes to your clipboard exactly as written. Nothing is trimmed.
Fill in the blanks
Replace [PIECE OF CODE] [ERROR] with your own details. Everything in square brackets is a blank for you to fill in.
Paste it into your assistant
Checked against Mistral, ChatGPT, Claude. It is written as plain instructions, so paste it into whichever of them you already use.
Read the result, then push back
Compare what you get to the example below. If it is close but not right, say what to change: shorter, warmer, more specific, then ask again in the same conversation.
More prompts like this one
Close neighbours in Programming, by shared subject and tagging.
- Evaluate and Integrate New Software Development Methodology into Team Workflow
- Evaluate and Integrate a New Software Library into an Existing Codebase
- Strategic Plan for Developing Features Using Unfamiliar Programming Languages
- Create a Comprehensive Mobile App Development Roadmap for a Startup
- Explain the Role and Implementation of Input Validation in Web Application Security
- Code Quality Advocate Challenge: Refactor Inefficient Code for Readability and Performance
Reviews and questions
What other people got out of this prompt, and what they asked about it.
Sign in to review this prompt.
Sign In to ReviewNo reviews yet
Be the first to share how this prompt worked for you.
Ask how to customize, adapt, or use this prompt more effectively.
Sign In to AskNo questions yet
Have a question about using or customizing this prompt? Be the first to ask.