8 Tips Plus A Bonus To Supercharge Your Development With ChatGPT

The amazing leaps and bounds in the past few months with generative AI have changed the landscape for how AI will drive faster efficieny. ChatGPT is going to revolutionize development. Don’t believe me? Well here are 8 ways to interact with ChatGPT to super charge your development right now! Get started right here - https://chat.openai.com

1. Generate boiler plate code

Ever sat down to start your next project and then had to go do a bunch of searching to figure out the right starting point. I have. Every. Single. Time. Probably because I am not coding everyday anymore but still, its a pain. ChatGPT makes this so much more efficient. Not only giving you the starting point but also a recommended structure too.

ChatGPT generates boilerplate code

prompt: generate the code for a boiler plate express app using a recommended folder structure

2. Explain code

In a previous blog post I talked about moldable development - the concept of which is driven from the fact that, as developers, 50% or more of our time is spent just trying to figure out what the code actually does. Give ChatGPT some code and ask it to explain it for you. Its amazing.

ChatGPT explains code

prompt: can you explain what this function does [insert function]

3. Comment code/write documentation

Ever written a bunch of code, got it to do what you needed then realized you didn’t really document it properly. ChatGPT can now do that for you, inline and everything and it never gets lazy.

ChatGPT comments code

prompt: can you comment this function

4. Optimize functions

This one is kinda mind blowing. You have some code but it does not perform as fast as you would like. Ask ChatGPT for some guidance. Recently, a colleague used this to uncover an elegant performance fix to a challenging problem - mind blown.

ChatGPT optimizes code

prompt: can you optimize this function

5. Write unit tests

No one likes writing unit tests. Not really. Well, some people might perhaps - but for most of us they are a necessary pain. Now ChatGPT can help take the drudgery out of this.

ChatGPT writes unit tests

prompt: can you write a unit test for this function

6. Write code for you

Look, we have all gone out there and found that snippet on Stack Overflow. Now we can just ask ChatGPT to give us exactly what we want. This is game changing.

ChatGPT writes code

prompt: generate a javascript function that gets the price of bitcoin

7. Generate regexes

Need to parse a string input for a something that in plain language is straight forward to describe but getting a computer to do consistently is actually quite hard. Enter regex. But trying to figure out the exact one to cover all your scenarios is more trial and error (or lots of searching). ChatGPT makes this a breeze.

ChatGPT writes regex

prompt: give me a regex for finding all words beginning with f in a string

8. Find bugs

Function not working and you can’t figure out why? Maybe ChatGPT can help?

ChatGPT finds a bug

prompt: this c# function throws an error but i am not sure why [insert function]

and finally, as a bonus, get it to write comments in the style of a sarcastic cowboy

ChatGPT writes funny comments

prompt: can you add comments to this code in the style of a sarcastic cowboy [insert function]