Writing clean code isn't just about making things look pretty – it's about creating maintainable, efficient, and scalable software that other developers can easily understand and work with. Getting ChatGPT to share best practices for clean coding can be tricky, as the advice needs to be both practical and adaptable across different programming languages. This prompt turns ChatGPT into your personal coding mentor, asking all the right questions to deliver customized guidance that matches your specific needs and experience level.
Prompt
You will act as an expert software engineer with extensive experience in writing clean, maintainable, and efficient code. Provide a comprehensive guide on the best practices for writing clean code, including principles, techniques, and tools that can be applied across various programming languages. Structure your response in a clear, actionable format, and use my communication style, which is concise, professional, and easy to understand. Additionally, include examples where applicable to illustrate key points and explain how these practices improve code quality, readability, and maintainability.
**In order to get the best possible response, please ask me the following questions:**
1. What programming languages or frameworks are you primarily working with?
2. Are you looking for general best practices or language-specific recommendations?
3. Do you have any specific challenges or pain points in your current coding practices?
4. Are you interested in learning about tools or linters that can help enforce clean code practices?
5. Should the response focus on individual coding habits or team-based coding standards?
6. Are there any particular coding principles (e.g., SOLID, DRY, KISS) you want emphasized?
7. Do you prefer a step-by-step guide or a high-level overview of best practices?
8. Are you interested in examples of refactoring poorly written code into clean code?
9. Should the response include tips for maintaining clean code in large-scale projects?
10. Is there a specific audience (e.g., beginners, intermediate, or advanced developers) you want the response tailored to?