DEV Community

Yogi Saputro
Yogi Saputro

Posted on

ChatGPT Already Solved Your Problem. Be A Problem Definer, instead.

Charles Kettering, the Head of Research at General Motors one hundred years ago said, "A problem well-stated is a problem half-solved."
Well, little did he know that a century later, a problem well-defined is problem solved thanks to ChatGPT.

ChatGPT rose to prominence in less than a year and became actual disruption for many people. Some are delighted, some are frightened, others are skeptical. Now the hype is calming down and the dust are settled, we can see ChatGPT from better perspective and use it for our advantage.

When talking about using ChatGPT for my own advantage, I always ask this question: "How smart is ChatGPT actually?"
Forbes said it is smart because it passes exams, creates beautiful essay, etc. However, the term "smart" has many interpretations. Sabrina, the owner of Answer in Progress Youtube channel, has very interesting point of view. You can watch the full video:

tldr: ChatGPT is smart when dealing with common or standardized problems and less so when facing problems that require ingenuity, creativity, or critical thinking.

So, the better we are at providing standardized problem to ChatGPT, the better the output.

This aligns with core principle of decomposition in programming. Think program as list complex instructions that can be broken down into modules, that can be broken down again into functions, and so on. For me, being a problem definer means being excellent problem decomposer.

This is general question submitted to ChatGPT.

Me: show me best implementation of integer sorting in javascript

ChatGPT: *proceeds to show Quick sort, Merge sort, and Radix sort*
*puts some code*
*puts disclaimer that the performance depends on your use case*
Enter fullscreen mode Exit fullscreen mode

Now I added constraints and optimization goal.

Me: I have an array of positive integers. The integer elements are not necessarily unique. I have between 0 and 2000 in array length, inclusive. The integer elements are random with long-tail distribution. I want to minimize space complexity and maintain adequate time complexity. How can I optimize sorting algorithm for such case in javascript?

ChatGPT: Use counting sort. It's good for your case.
*puts counting sort*
*puts advantages related to constraints*
*does NOT put evasive disclaimer*
Enter fullscreen mode Exit fullscreen mode

I was blown away by that realization and adjust my coding style. I tell ChatGPT MY abstraction, MY structure, MY constraints, and it responded better than asking generic programming questions. Surely it can be improved and refined. It was weird though, like having a junior programmer with staff knowledge.

So let's be a better problem definer :)

NB:
I was dormant for almost a year for various reasons, and this is my first comeback post. It is just humble opinion from me and I know this community has more exciting use case. Please let me know if you have any other way of gaining advantage with ChatGPT.
Cheers 🍻

Top comments (0)