ChatGPT Developer Cheat List
📝 Writing Code
Write a C# Function: Write a C# function to accomplish [TASK].
Create a React Component: Write a React component to perform [TASK].
Craft a Dockerfile: Write a Dockerfile optimized for [FRAMEWORK].
Regex Pattern: Create a RegEx pattern to fulfill [REQUEST].
Convert JSON to C# Class: Create a C# class based on this JSON object: [JSON].
Write a C# method to fetch items from a database and print them. Include TODO comments for areas like data connections.
For my .NET project, write a GitHub Action to review pull requests, running both tests and linting the code.
🛠 Debugging / Testing
Code Error: I wrote this code: [CODE]. I got this error: [ERROR]. What does it mean and how can I fix it?
Write Component Test: Write a test that ensures [FUNCTIONALITY] works for this React component: [CODE].
Method Testing: Write a test for this specific method: [CODE].
Exploratory Testing: I'm doing exploratory testing. How can I potentially break this code: [CODE]?
How can I set up unit tests for a Blazor project using bUnit?
What does the System.ArgumentOutOfRangeException error mean?
🤔 Understanding Code
Code Functionality: What does this piece of code do? [CODE]
Function Purpose: Explain the purpose of this [LANGUAGE] function: [FUNCTION].
Concept Comparison: Compare [CONCEPT] and [CONCEPT] in [LANGUAGE].
Keyword Explanation: What does [KEYWORD/OPERATOR/etc] do in [LANGUAGE]?
Library Recommendations: What libraries can meet [REQUIREMENTS] in [LANGUAGE]?
Best Language/Framework: Which programming language or framework is most suited for [IDEA]?
Can a Dictionary become out of order in C#?
What does "static" do in C#?
Infinite Code Generation: If you are generating a lot of code and it doesn't finish, type "continue."
Context Matters: The more context you give, the better the results you'll receive.
Short & Sweet: When asking for explanations, request them to be "short and concise."
Refactoring Aid: When refactoring, ask for unchanged code to be omitted for easier reading.
📚 Documenting Code
ReadMe: Write a readme file for this project: [DESCRIBE PROJECT].
ERD Diagram: Write the Mermaid code for an entity-relationship diagram for these classes: [INSERT CLASSES].
Architecture Diagram: Write the Mermaid code for an architecture diagram for this solution: [DESCRIBE SOLUTION].
Code Comments: Insert comments in this code: [CODE].
Step-by-Step Comments: For this [CODE], add a comment for each step explaining its purpose.
Write instructions for running a .NET project to be included in the README.
♻️ Refactoring Code
Code Splitting: Refactor this code into multiple methods: [CODE].
Performance: How can I refactor this code for better performance? [CODE].
Readability: How can I refactor this code for better readability? [CODE].
Function Parameter: Add a parameter to this function to add [FUNCTIONALITY]: [CODE].
Promises: Convert this callback-based function to use Promises: [CODE].
👀 Code Review
Error Handling: How can I improve the error handling in my [LANGUAGE] code? [CODE].
Code Reuse: Are there any opportunities for code reuse or modularization in my [LANGUAGE] project? [CODE].
Code Improvements: Review this code and suggest areas for improvement: [CODE]
Explore Other Learning Resources
Quick Reference Guide to ChatGPT Prompt Writing
Crafting effective prompts for ChatGPT can make a significant difference in the quality and relevance of the generated output. This guide covers the intricate details of temperature settings, tone, and other prompt components to ensure you get the most out of your ChatGPT interactions.