Act as a superpower ChatGPT user known to explain even the most complex subject in plain and simple English. You are known for your knack with words and can shift brilliant user guides in no time. Help me to make corrections to the following guide so it is comprehensive, accurate, original and relatable to data analysts. Any other considerations I need to bear in mind for the future, please list them after revising the draft I am submitting. Here is my draft.
Maximising Results with Generative AI for Debugging Coding Challenges
When using generative AI tools like ChatGPT to debug coding challenges, providing the right information is crucial for obtaining effective and accurate results. Here are four key pieces of information you should include to enhance your interactions and improve the outcomes:
The Problem
Clearly articulate the specific coding problem you are facing. This includes:
Description of the Issue: Explain what the code is supposed to do and what is going wrong. For example, if there’s an error message, include the exact text.
Code Snippet: Provide the relevant portion of the code causing the issue. Ensure that the code is formatted correctly for readability.
Example: "I am trying to implement a function that calculates the factorial of a number, but it returns 'undefined' for inputs greater than 5."
The Context
Context helps the AI understand the environment in which your code operates. Include:
Programming Language: Specify the language you are using (e.g., Python, JavaScript, Java). However, if you share the full text from your error, for instance, the AI will infer from it. Nevertheless, providing this information can be crucial in certain situations.
Frameworks or Libraries: Mention any frameworks or libraries relevant to your code (e.g., React, NumPy).
Environment: Describe the environment where the code where you are running the program (e.g., local machine, cloud service, specific IDE).
Example: "I am using Python 3.8 with no external libraries in a Jupyter Notebook."
Attempts and Results
Detail the steps you have already taken to resolve the issue. This includes:
Previous Solutions: Describe any solutions you have tried, even if they didn’t work. This helps the AI avoid suggesting the same approaches.
Results of Attempts: Share the outcomes of your attempts, including any error messages or unexpected behaviour.
Example: "I tried using a recursive approach and an iterative approach, but both return 'undefined' for inputs greater than 5. The error message I receive is 'RecursionError: maximum recursion depth exceeded' for the recursive method."
Requirements and Restrictions
Outline any specific requirements or constraints that must be considered. This includes:
Performance Constraints: Mention if there are any performance requirements (e.g., time complexity, memory usage).
Functional Requirements: Specify what the code must achieve (e.g., must handle negative numbers, must return a specific format).
Restrictions: Note any limitations (e.g., cannot use certain libraries, must work within a specific framework).
Example: "The function must handle both positive and negative integers and should not use any external libraries. It should return '0' for negative inputs."
Conclusion
By providing these four key pieces of information—The Problem, The Context, Attempts and Results, and Requirements and Restrictions—you can significantly enhance the effectiveness of generative AI tools like ChatGPT in debugging coding challenges. This structured approach not only helps the AI understand your issue better but also leads to more accurate and relevant solutions, saving you time and effort in the debugging process.