Changes between Version 1 and Version 2 of SOPs/AIcodingTools
- Timestamp:
- 02/19/26 15:11:18 (43 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SOPs/AIcodingTools
v1 v2 1 Why AI for coding? 1 == '''Why AI for coding?''' 2 2 • Efficient: automatic code/documentation generation 3 3 • Speed: accelerate data analysis pipeline development … … 6 6 7 7 ---- 8 What is an AI Coding Assistant? 8 == '''What is an AI Coding Assistant?''' 9 9 • Definition: Large language model (LLMs) trained on massive code datasets. 10 10 • Key capabilities: Code generation, code completion, Documentation, Language translation (e.g., python to R) 11 11 12 '''Set Clear Expectations''' 12 13 13 ---- 14 Key Features of AI Coding Assistants 14 AI is a pair programmer, not a replacement for developer judgment. It accelerates work but requires human oversight. 15 16 '''Key Features of AI Coding Assistants''' 15 17 ||=Feature=||=Description=|| 16 18 ||Code suggestions||Provides code suggestions based on comments and file context|| … … 28 30 29 31 30 ---- 31 Popular Tools for AI coding 32 33 '''Popular Tools for AI coding''' 32 34 • Chat-based (ChatGPT, Gemini, Claude) Best for: reasoning, debugging, learning, prompt iteration 33 35 • IDE-integrated (Github Copilot, Cursor, Claude Code) Best for: writing code faster inside existing projects … … 35 37 36 38 ---- 37 General guidelines when using AI for coding 38 1. Clear Problem Definition 39 == '''General guidelines when using AI for coding''' 40 '''1. Clear Problem Definition''' 39 41 * Best Practice: Before asking ChatGPT for help, clearly define the problem or task. A well-defined question improves the quality of the response. 40 42 41 43 * Example: Instead of saying “Fix my code,” provide context such as “I'm trying to optimize this Python function that clusters the sequence alignment positions in proximity recursively, but it's too slow for large inputs. How can I improve it?” 42 44 43 2. Break Problems into Smaller Chunks 45 '''2. Break Problems into Smaller Chunks''' 44 46 * Best Practice: For complex tasks, break the problem down into smaller, manageable steps. Ask about each step individually to get focused and accurate assistance. 45 47 46 48 * Example: Rather than asking for a full solution in one go, ask for help with specific functions, then how to test them, and finally how to integrate them into your larger project. 47 49 48 3. Iterate and Refine Your Questions 50 '''3. Iterate and Refine Your Questions''' 49 51 * Best Practice: If the initial response isn’t quite right, clarify your question and ask for refinement. ChatGPT often improves its responses based on follow-up queries. 50 52 51 53 * Example: “The solution works, but it doesn't handle edge cases where the input is negative. Can you adjust it?” 52 54 53 4. Ask for Explanations, Not Just Code 55 '''4. Ask for Explanations, Not Just Code''' 54 56 * Best Practice: Don’t just request code; ask for an explanation of how and why it works. This helps you learn and apply the knowledge in future problems. 55 57 56 58 * Example: “Can you explain why you're using a heuristic search algorithm here and how it improves the time complexity?” 57 59 58 5. Use ChatGPT for Code Reviews 60 '''5. Use ChatGPT for Code Reviews''' 59 61 * Best Practice: Ask ChatGPT to review your code for potential improvements in readability, performance, or best practices. 60 62 61 63 * Example: “Can you review this Python function for any inefficiencies or suggest improvements for readability?” 62 64 63 6. Leveraging ChatGPT for Debugging 65 '''6. Leveraging ChatGPT for Debugging''' 64 66 * Best Practice: Provide the exact error message and a concise description of what the code is supposed to do when asking ChatGPT for debugging help. 65 67 66 68 * Example: “I’m getting a TypeError in this Python code when trying to perform a log transformation. Can you help me identify why this is happening?” 67 69 68 7. Specify Language, Framework, and Version 70 '''7. Specify Language, Framework, and Version''' 69 71 * Best Practice: Always mention the programming language, framework, and version you're using to avoid receiving outdated or incompatible code. 70 72 71 73 * Example: “I have a Python script created by Python 2.7. Could you please modify it to be compatible with Python 3.8?” 72 74 73 8. Request Test Cases 75 '''8. Request Test Cases''' 74 76 * Best Practice: Ask for test cases when getting help with functions or algorithms to ensure the solution is robust. 75 77 76 78 * Example: “Can you provide a few test cases to verify that this sorting algorithm works with edge cases like empty lists or lists with duplicate values?” 77 79 78 9. Use ChatGPT as a Learning Tool 80 '''9. Use ChatGPT as a Learning Tool''' 79 81 * Best Practice: Don’t just use ChatGPT to get answers—use it as a learning resource. Ask it to explain new concepts or techniques introduced in its responses. 80 82 81 83 * Example: “You used dimentionality reduction in this solution. Can you explain what that is and when it should be used?” 82 84 83 10. Understand Limitations and Double-Check Critical Code 85 '''10. Understand Limitations and Double-Check Critical Code''' 84 86 * Best Practice: ChatGPT might not always produce the optimal or correct code, especially in complex scenarios. Always review and test the code yourself. 85 87
