Write better code with ChatGPT
While ChatGPT and other instruction-following large language models have impressive abilities in generating software code, they are no replacement for programmers. They cannot think through complex problems, plan and reason, and implement complex and multi-layered solutions. They can generate deprecated code, non-working code, and even insecure code.
However, if used correctly, ChatGPT can improve your coding productivity immensely. In my latest TechTalks column, I provide four key tips that have helped me a lot in using ChatGPT in programming:
Don’t trust if you can’t verify: My rule of thumb with ChatGPT is to only use it as a helper in tasks in which I can understand and verify every single line of code.
Iterate one chunk at a time: Don’t expect ChatGPT to implement a fully functional solution to a complex problem. Instead, break down your task into smaller steps and have the LLM implement it one step at a time.
Provide feedback: When you’re not satisfied with the code that ChatGPT has generated, provide it with feedback and the correct code. This will help it avoid similar mistakes down the line.
Clean ChatGPT’s context: ChatGPT is very sensitive to the context of your chat history. When the conversation becomes very long, start with a fresh chat and a distilled version of everything you have done so far.
Read the full article on TechTalks.
For more on large language models: