Changes between Initial Version and Version 1 of SOPs/AIcodingTools


Ignore:
Timestamp:
02/19/26 13:40:26 (2 days ago)
Author:
xinlei.gao
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SOPs/AIcodingTools

    v1 v1  
     1Why AI for coding?
     2• Efficient: automatic code/documentation generation
     3• Speed: accelerate data analysis pipeline development
     4• Troubleshooting: get instant help with complex R/python errors
     5
     6
     7----
     8What is an AI Coding Assistant?
     9• Definition: Large language model (LLMs) trained on massive code datasets.
     10• Key capabilities: Code generation, code completion, Documentation, Language translation (e.g., python to R)
     11
     12
     13----
     14Key Features of AI Coding Assistants
     15||=Feature=||=Description=||
     16||Code suggestions||Provides code suggestions based on comments and file context||
     17||Context-aware completions||Offers context-aware code completions based on all or a part of the codebase||
     18||Test generation||Analyzes code to generate tests||
     19||User-IDE interaction||Automatically provides guidance as users type code in the IDE; Chat within IDE||
     20||Code analysis||Analyze code snippets to provide reliable code prediction and tag suspicious code||
     21||Bug detection and fixing||Identifies bugs and suggests to fix them||
     22||Code autodocumentation||Automatically adds docstrings and enhances code documentation||
     23||Routine task automation||Helps with code creation for routine or time-consuming tasks||
     24||API and SDK usage optimization||Aids in making correct and effective use of APIs and SDKs||
     25||Open source discovery and attribution||Facilitates discovery and attribution of open source code and libraries||
     26
     27*Source: AI-Assisted Programming, by Tom Taulli (O’REILLY)
     28
     29
     30----
     31Popular Tools for AI coding
     32• Chat-based (ChatGPT, Gemini, Claude) Best for: reasoning, debugging, learning, prompt iteration
     33• IDE-integrated (Github Copilot, Cursor, Claude Code) Best for: writing code faster inside existing projects
     34
     35
     36----
     37General guidelines when using AI for coding
     381. Clear Problem Definition
     39* Best Practice: Before asking ChatGPT for help, clearly define the problem or task. A well-defined question improves the quality of the response.
     40
     41* 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
     432. Break Problems into Smaller Chunks
     44* 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
     46* 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
     483. Iterate and Refine Your Questions
     49* 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
     51* Example: “The solution works, but it doesn't handle edge cases where the input is negative. Can you adjust it?”
     52
     534. Ask for Explanations, Not Just Code
     54* 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
     56* Example: “Can you explain why you're using a heuristic search algorithm here and how it improves the time complexity?”
     57
     585. Use ChatGPT for Code Reviews
     59* Best Practice: Ask ChatGPT to review your code for potential improvements in readability, performance, or best practices.
     60
     61* Example: “Can you review this Python function for any inefficiencies or suggest improvements for readability?”
     62
     636. Leveraging ChatGPT for Debugging
     64* 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
     66* 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
     687. Specify Language, Framework, and Version
     69* Best Practice: Always mention the programming language, framework, and version you're using to avoid receiving outdated or incompatible code.
     70
     71* Example: “I have a Python script created by Python 2.7. Could you please modify it to be compatible with Python 3.8?”
     72
     738. Request Test Cases
     74* Best Practice: Ask for test cases when getting help with functions or algorithms to ensure the solution is robust.
     75
     76* 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
     789. Use ChatGPT as a Learning Tool
     79* 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
     81* Example: “You used dimentionality reduction in this solution. Can you explain what that is and when it should be used?”
     82
     8310. Understand Limitations and Double-Check Critical Code
     84* Best Practice: ChatGPT might not always produce the optimal or correct code, especially in complex scenarios. Always review and test the code yourself.
     85
     86* Example: After receiving code from ChatGPT, test it thoroughly, and if it’s a critical part of your project, cross-reference it with documentation or experienced developers.
     87
     88----
     89