ChatGPT: Your Secret Weapon in Development

ChatGPT can be a powerful tool for an experienced developer when used carefully and judiciously.

August 7, 2023

Coding Potential With ChatGPT

Explore the potential of ChatGPT as a powerful development tool in the hands of experienced devs. Learn best practices and use cases for code generation, testing, and knowledge enhancement.

There’s a lot of talk about how ChatGPT and generative AI will generally replace … well … everything. Be it technical writers, illustrators, developers, and market research analysts – many feel that ChatGPT is a threat. As for developers? Well, it’s still early days, but at the moment, ChatGPT and other generative AI are not a threat but rather a tool. And the more experienced the developer, the greater opportunities to use ChatGPT for tasks such as automation and test development to make the job easier and more efficient. 

ChatGPT isn’t an immediate threat to developers, and it doesn’t take much time working with it to understand why. Look at how ChatGPT and other generative AI have treated other industries. Publications that have tried to use ChatGPT to produce articles got readable, if mundane, text, but unfortunately, it’s often riddled with errors of fact. Those who simply used what ChatGPT produced found themselves in an embarrassing spot once those errors came to light.

We have the same problem when asking ChatGPT to generate code. No company generates code from ChatGPT and rolls it into production, not if they expect to be in business for very long. Certainly, ChatGPT can supply code, and often, while the code is usable, it typically requires small but important adjustments. Any organization using ChatGPT to generate code had better ensure that a skilled developer constantly looks over ChatGPT’s shoulder.

But the potential for introducing bugs and even superfluous nonsense into the codebase is only one of the many concerns developers should consider as they use this new tool. Because developers should take care when using it, ChatGPT and other generative AI can be powerful tools in the hands of an experienced developer. 

See More: Google Alarmed Over ChatGPT — To Respond With AI

ChatGPT Use Cases

There are many potential use cases, including, yes, code generation. ChatGPT, if prompted correctly, can help developers arrive at solutions much faster. Given ChatGPT’s reputation, no one should use the code line for line. Nevertheless, ChatGPT can provide a  framework to build upon. However, ChatGPT is best suited to generate code for discrete, specific, often repetitive tasks. For example, ChatGPT is typically very good at producing code for simple tasks such as writing a data connector between two applications or shaping a suite of automated tests. 

The more complex or unique the task, the less likely ChatGPT is to produce good code. Treat it like you would something you pulled off of Stack Overflow or another forum . Carefully check the code before using it. After all, ChatGPT likely scraped it off some other site and, maybe, lightly modified it. The code may be useful, but you don’t know its provenance. Be careful. 

ChatGPT is also a great source of developer training and knowledge. So many new languages appear every week- sometimes every day- that only some people can keep up with them. Don’t know what a higher-order function in Typescript looks like? Ask ChatGPT to explain the concept and provide examples. Let’s say you’re great with Ruby but a newbie at Python. Ask it to provide examples of class objects in Python or any other concept you feel inexpert.

Generative AI can also be very helpful in producing tests for QA because while testing is automated, a developer has to author code to generate the tests most of the time. So long as the prompt describes the test well, ChatGPT can provide a good first stab at the code. A savvy developer can quickly determine how to iterate on this initial code with additional prompts that provide more context. Plus, experienced coders know what the test code should look like, so they can tell when it’s in the right place. After a few minutes of checking and tweaking, the test is ready to put through its paces, saving the developer and the client much time. 

Developers typically hate writing documentation, so they outsource some of it to ChatGPT. Again, there are better ideas for complex code. Still, it does a nice job providing documentation for run-of-the-mill, mundane items, such as the expected inputs and outputs for this connector from specific endpoints. Check its work, of course, ideally multiple times, but this capability can enable developers to spend more time coding and less writing documentation.

Finally, ChatGPT can automate certain tasks through Auto-GPT, an AI “agent” that performs functions as an automated loop. For example, you could use it for lead generation by asking it to send you a weekly, one-page list of companies of a certain size with a web page at least three years old written in WordPress. 

See More: ChatGPT vs. Bing vs. Google Bard

Best Practices for Using ChatGPT

In addition to these use cases, we’ve learned best practices for getting the most out of ChatGPT and protecting yourself from its potential downside. These include:

  1. Be as specific as possible: Provide as much context as possible, and remember that you can tell it how to spit information back. ChatGPT can be verbose with a giant wall of text and a little block of code. Specify what you want and how you want it. For example, here’s a sample query I might use: “As a programming assistant, I’m trying to connect a Postgres database hosted in AWS, and I’m using React as my language. Give me a connection string substituting any connection parameters with a curly brace, and I’ll provide follow-up questions if I need more.”
  2. Know the bounds of truth for an acceptable answer: While ChatGPT is a good source of knowledge for developers and even for code, it’s not always a good tool for inexperienced programmers. Unless you have a good idea of the right answer or, at the very least, can recognize when something is out of whack, there’s no way you’ll be able to use ChatGPT effectively. You must be able to separate the wheat from the chaff. Otherwise, your ChatGPT-assisted code will be riddled with bugs if it works.
  3. Don’t share proprietary code or identifying information: ChatGPT is always learning, so be careful what you put in your prompt. Their researchers can read your input and use it to train the AI further, which means any code you use as input could show up for someone else as output in some form. From the ChatGPT FAQOpens a new window :

Who can view my conversations?

As part of our commitment to safe and responsible AI, we review conversations to improve our systems and to ensure the content complies with our policies and safety requirements.

Will you use my conversations for training?

Yes. Our AI trainers may review your conversations to improve our systems.

Using the ChatGPT API should protect this, as their terms state they won’t use input from the API in training. But it’s best to be careful, even then.

ChatGPT will only improve over time, and it’s impossible to say how it will affect the development profession, though it will transform how we do our jobs. So experienced, savvy developers will begin learning how to use this powerful tool to generate frameworks for development, learn about new languages and test their code. 

Have you started using ChatGPT in your development workflow? What best practices are you employing for smarter coding? Let us know on FacebookOpens a new window , TwitterOpens a new window , and LinkedInOpens a new window . We’d love to hear from you!

Image Source: Shutterstock

MORE ON CHATGPT

Jeremy Jackson
Jeremy Jackson is the founder and CEO of Shift Lab, an NYC-based digital product design and agile development agency that provides businesses with endless product vision. Jeremy Jackson has built Shift Lab into the development partner of choice for design agencies and organizations as varied as Google, Meta, Breastcancer.org, Fora Travel, Gray Malin, and more. Jeremy’s team is known for bringing artistry and skill to every development project they work on, and he’s the go-to consultant for complex development projects other firms cannot execute.
Take me to Community
Do you still have questions? Head over to the Spiceworks Community to find answers.