4 Ways ChatGPT can supercharge your development process
1) Writing Documentation
Documentation, an oft-neglected but critical component in development, is one of the low hanging fruits for ChatGPT. Nobody wants to write it, but everybody wants it.
I’ve come across scenarios where new developers have joined teams only to be overwhelmed by the industry jargon, internal tools, and coding practices. This can easily be solved with good documentation.
Enter ChatGPT. It’s no secret that ChatGPT can pump out Ivy League quality essays. Developers will be able to generate high-quality documentation for their code in a matter of minutes. This will undoubtedly save time and ensure that the code is well-documented and easy to understand for other developers.
2) Stakeholder Management
Writing documentation is great and all, but what about emails or text messages?
As an AI that was trained to be impartial and provide information that is factual and unbiased, and also not capable of expressing personal opinions (yet), ChatGPT is a great tool to help come up with basic template responses.
This is incredibly handy when emotions and stress run high at work, and you want to refrain from letting your emotions get the better of you.
Here are some scenarios where you could turn to ChatGPT to draft up an impartial response:
- An apology email after an argument with a colleague
- One of your subordinates is habitually coming to work late; you want to address their tardiness and the negative impact it has on the team
- Asking your manager for a raise
3) Code Suggestions
Just like its fellow AI trained counterpart, GitHub Copilot, suggesting code snippets or writing complete functions based on a specific context is no problem for ChatGPT.
This is an incredibly handy use-case, enabling an easier and more efficient way to write code. This can also introduce you to new methodology or coding techniques!
I recently tried incorporating a d3 bar chart into a project using ChatGPT. The results were mind blowingly accurate, to say the least.
4) Review your code
This partially ties into the previous point, but one thing I have been asking ChatGPT to do lately is review chunks of my code that I knew could use some cleaning up.
I gave it this snippet of unoptimised React code as a test:
kanji
.filter(kanji => kanji.jlpt_new === level)
.sort((a, b) => b.jlpt_new - a.jlpt_new)
.filter(
kanji => !learnedKanjiArray.some(k => k.character === kanji.character)
)
.map((item, index) => (
<button key={index} onClick={() => showModal(item)}>
{item.character}
</button>
))
And this was the result:
1. Avoid chaining filter functions: The current implementation of the code uses two separate
filter
functions, which might be slightly less efficient than using a singlefilter
function with multiple conditions.2. Use a unique key for each list item: In the current implementation, the key for each list item is based on its index in the list, which can cause issues if the list order changes. To avoid this, consider using a unique identifier for each item, such as its
character
property.
return (
<>
{kanji
.filter(kanji => kanji.jlpt_new === level && !learnedKanjiArray.some(k => k.character === kanji.character))
.sort((a, b) => b.jlpt_new - a.jlpt_new)
.map(item => (
<button key={item.character} onClick={() => showModal(item)}>
{item.character}
</button>
))}
</>
);
In this version, we’re combining the two separate
filter
functions into a singlefilter
function that checks both conditions. We're also using thecharacter
property as the key for each list item to ensure uniqueness.I hope this helps!
Impressive!
There are limitless applications for ChatGPT as the technology evolves, and I’m excited to witness the future. Along with GitHub Copilot 2 years ago, these incredibly disruptive tools are what makes software development so exciting!