11 ways ChatGPT saves me hours of work every day, and why you'll never outcompete those who use AI effectively.

A list for those who write code:

1 of 16

1. Explaining code

Take some code you want to understand and ask ChatGPT to explain it.

I've found explanations are very detailed. This is much quicker than trying to figure out convoluted code.

2 of 16
2. Improve existing code

Ask ChatGPT to improve existing code by describing what you want to accomplish.

It will give you instructions about how to do it, including the modified code.

3 of 16
3. Rewriting code using the correct style

This is great when refactoring code written by non-native Python developers who used a different naming convention.

Notice how ChatGPT not only gives you the updated code; it also explains the reason for the changes.

4 of 16
4. Rewriting code using idiomatic constructs

Very helpful when reviewing and refactoring code written by non-native Python developers.

ChatGPT knows the "Pythonic" way, and it will give you suggestions to improve your code and make it much more readable.

5 of 16
5. Simplifying code

This is one of my favorite tricks: Ask ChatGPT to simplify complex code.

The result will be a much more compact version of the original code.

Notice the explanation and how it tells us this is simpler but not the most efficient.

6 of 16
6. Writing test cases

This has become one of my favorite ChatGPT abilities: Ask it to help you test a function, and it will write test cases for you.

This example focuses on the quick_sort function from the previous example.

7 of 16
7. Exploring alternatives

ChatGPT told me its Quick Sort implementation wasn't the most efficient, so I asked for an alternative implementation.

This is great when you want to explore different ways to accomplish the same thing.

I've learned a ton from this!

8 of 16
8. Translating code

Anytime you want to port some code from one language to another, ask ChatGPT to help you.

9 of 16
9. Writing documentation

This is another one of my favorite tricks.

Ask ChatGPT to write the documentation for a piece of code, and it usually does a great job.

It even includes usage examples as part of the documentation!

10 of 16
10. Tracking down bugs

If you are having trouble finding a bug in your code, ask ChatGPT for help.

It took ChatGPT seconds to find the bug in the attached example. I don't know about you, but it would have taken me much longer than that.

11 of 16
11. Scaffolding

Probably the way I use it the most is to kick off the structure of anything new I want to write. GitHub Copilot does a great job at this as well.

An example where this is very useful is when interacting with a RESTful API.

12 of 16
Something to keep in mind:

I have 2+ decades of programming experience. I like to think I know what I'm doing.

I don't trust people's code (especially mine,) and I surely don't trust ChatGPT's output.

13 of 16
This is not about letting ChatGPT do my work. This is about using it to 10x my output.

ChatGPT is flawed. I find it makes mistakes when dealing with code, but that's why I'm here: to supervise it.

Together we form a more perfect Union. (Sorry, couldn't help it)

14 of 16
Developers who shit on this are missing the point.

The story is not about ChatGPT taking programmers' jobs. It's not about a missing import here or a subtle mistake there.

The story is how, overnight, AI gives programmers a 100x boost.

Ignore this at your own peril.

15 of 16
Next time, I'll show you how to build an end-to-end deep learning model using ChatGPT.

I'll only ask questions.

It'll blow your mind.

Follow me @svpino to ensure you don't miss it.

16 of 16

More from Santiago

You gotta think about this one carefully!

Imagine you go to the doctor and get tested for a rare disease (only 1 in 10,000 people get it.)

The test is 99% effective in detecting both sick and healthy people.

Your test comes back positive.

Are you really sick? Explain below 👇

The most complete answer from every reply so far is from Dr. Lena. Thanks for taking the time and going through


You can get the answer using Bayes' theorem, but let's try to come up with it in a different —maybe more intuitive— way.

👇


Here is what we know:

- Out of 10,000 people, 1 is sick
- Out of 100 sick people, 99 test positive
- Out of 100 healthy people, 99 test negative

Assuming 1 million people take the test (including you):

- 100 of them are sick
- 999,900 of them are healthy

👇

Let's now test both groups, starting with the 100 people sick:

▫️ 99 of them will be diagnosed (correctly) as sick (99%)

▫️ 1 of them is going to be diagnosed (incorrectly) as healthy (1%)

👇

You May Also Like

The first ever world map was sketched thousands of years ago by Indian saint
“Ramanujacharya” who simply translated the following verse from Mahabharat and gave the world its real face

In Mahabharat,it is described how 'Maharishi Ved Vyasa' gave away his divine vision to Sanjay


Dhritarashtra's charioteer so that he could describe him the events of the upcoming war.

But, even before questions of war could begin, Dhritarashtra asked him to describe how the world looks like from space.

This is how he described the face of the world:

सुदर्शनं प्रवक्ष्यामि द्वीपं तु कुरुनन्दन। परिमण्डलो महाराज द्वीपोऽसौ चक्रसंस्थितः॥
यथा हि पुरुषः पश्येदादर्शे मुखमात्मनः। एवं सुदर्शनद्वीपो दृश्यते चन्द्रमण्डले॥ द्विरंशे पिप्पलस्तत्र द्विरंशे च शशो महान्।

—वेद व्यास, भीष्म पर्व, महाभारत


Meaning:-

हे कुरुनन्दन ! सुदर्शन नामक यह द्वीप चक्र की भाँति गोलाकार स्थित है, जैसे पुरुष दर्पण में अपना मुख देखता है, उसी प्रकार यह द्वीप चन्द्रमण्डल में दिखायी देता है। इसके दो अंशो मे पीपल और दो अंशो मे विशाल शश (खरगोश) दिखायी देता है।


Meaning: "Just like a man sees his face in the mirror, so does the Earth appears in the Universe. In the first part you see leaves of the Peepal Tree, and in the next part you see a Rabbit."

Based on this shloka, Saint Ramanujacharya sketched out the map, but the world laughed