Embracing Generative AI in Coding: A Culinary Analogy
Written on
The Coding-Cooking Connection
Coding can be likened to cooking; utilizing ChatGPT for coding is akin to using a Kindle for recipes. But why should we embrace ChatGPT for programming without fear of ethical and legal ramifications?
When discussing AI, a well-known dilemma often arises. Consider a self-driving car: if an accident is imminent, should the AI prioritize the passengers' lives over others? If the AI swerves to save its occupants but endangers a pedestrian, who bears the responsibility—the vehicle's owner or the company behind the AI?
As a non-philosopher, I won't claim to have the answers. Yet, it’s clear that sensational stories about AI often gain traction in the media, leading the public to apply such scenarios across various fields without proper context. Typically, this occurs because most individuals lack expertise in those areas.
For instance, if a programmer uses ChatGPT to create code resulting in a significant malfunction or harm, should the developer or their company be held accountable, or is it the responsibility of ChatGPT? While disclaimers from ChatGPT suggest that no one is liable, many argue against using generative AI for coding due to perceived risks.
In my view, this situation presents a different context altogether, and such judgments seem misplaced. I believe we should welcome generative AI in programming. It enhances productivity for developers while avoiding ethical dilemmas.
What Constitutes a Coding Job?
Some might argue that coding is akin to writing, where software development resembles crafting an extensive essay. This comparison simplifies the concept but is ultimately inaccurate. Writing is more creative and unrestricted compared to coding. To illustrate this to a non-technical audience, I prefer to liken software development to cooking.
An Experienced Developer’s Perspective
Imagine you're an accomplished home cook, preparing delightful meals for your family daily. You're adept at making pasta, ramen, and noodle soup, with a well-stocked fridge and a clear plan for sourcing ingredients.
In this scenario, you're cooking familiar dishes regularly and likely don’t require assistance.
As an experienced Data Analyst, you frequently manipulate pandas dataframes, recalling essential functions for your routine tasks.
Stepping Outside Comfort Zones
One day, your child, tired of the usual noodle dishes, requests something different, mentioning a cake they enjoyed at a friend’s house. Despite it being your first attempt at baking, you know the basics: flour, eggs, and cream. You have an oven from previous cooking endeavors, so you feel prepared.
However, problems arise. You’re uncertain about the required quantities, the baking process, or any additional ingredients. Naturally, you want to avoid disappointing your child.
In this analogy, you’re tasked with a similar data analytics project using Apache Spark due to a larger dataset. You grasp that the transformation logic remains similar, but the differences between Pandas and Spark hinder your immediate transition.
Seeking External Guidance
You decide to visit a nearby bookstore in search of a cake cookbook. Unfortunately, the selection is limited, and you must travel further to find a store with a comprehensive collection. Eventually, you discover a thick cookbook filled with numerous cake recipes.
Correspondence
You search online for "how to use Apache Spark," but find only scattered information. Frustrated, you resort to the official documentation, which contains all the functions and instructions you need.
Stack Overflow: The Developer’s Lifeline
Suddenly, you recall that your neighbor is a professional chef. Visiting him, you request an orange cake recipe. He graciously provides one, but you discover it requires precise temperature control and features your home oven can’t accommodate.
Correspondence
Stack Overflow serves as every developer's neighbor. Many developers consult it multiple times daily, often finding solutions through minor modifications to existing code. However, when faced with unique issues, finding an appropriate solution can be challenging, necessitating a return to official documentation or seeking more expert help.
Generative AI: The Ultimate Solution
Just as you prepare to inform your child that the orange cake will have to wait, a friend calls, excited about her new Kindle. She’s acquired several PDF cookbooks and brags about its search feature.
You share your current predicament. She asks for the name of your cookbook and finds a PDF version on Kindle. Although she lacks cooking skills, she searches for orange recipes, using related terms like citrus and mandarin. She sends you ten recipes.
Despite her inexperience, she understands fruit types and their flavors. Even without reading the recipes, she can forward them to you. As a capable cook, you can follow any of these recipes!
You’ll choose one of the ten and give it a shot. If it doesn't meet your child's expectations, you still have nine other options to explore.
Correspondence
While ChatGPT may not “understand” code and can occasionally generate incorrect code, Stack Overflow is equally fallible. The advantage of ChatGPT lies in its ability to attempt to answer our inquiries rather than merely presenting a list of possible answers. Ultimately, developers must test and run the code, just as if they had written it themselves.
Who Holds the Responsibility?
Returning to the initial question, are there ethical or legal implications in using generative AI for coding? My answer is a resounding no.
Regardless of the source—official documentation, Google, Stack Overflow, or ChatGPT—we must comprehend, execute, and validate the code. If bugs arise, they can occur regardless of the source.
If we fail to understand the code, we might struggle even more without ChatGPT. The beauty of ChatGPT is its ability to explain the code, enhancing our understanding efficiently. Learning through official documentation can be time-consuming, and responses on Stack Overflow aren't guaranteed.
Returning to the Cooking Scenario
Suppose you select a recipe you believe will delight your child, but they’re not fond of it. What’s the next step? Naturally, you can try another recipe from the ten you received!
Correspondence
If the code fails to run or doesn’t solve the issue at hand, will you blame the cookbook, your neighbor, or your friend for providing a poor recipe? Avoid placing blame; you don’t want to jeopardize friendships.
As a competent home cook, you understand your child’s preferences better than anyone. Your sole aim was to bake an orange cake for your child. If they dislike it, any blame should rest with you.
Similarly, as developers, we grasp our requirements. Whether using Google, Stack Overflow, or ChatGPT, these tools assist us in solving problems. If we wouldn’t hold a Stack Overflow contributor accountable for bugs arising from copied code, we shouldn’t expect the same from generative AI.
Conclusion
In this discussion, I’ve shared my perspective on the value of generative AI, such as ChatGPT, in software development and data analytics. I aim to clarify for non-technical readers that programming differs significantly from writing an article. Seasoned developers do not merely sit and produce thousands of lines of code daily. Everyone relies on documentation, searches for solutions, or copies code from Stack Overflow. ChatGPT amalgamates these resources, providing quick, focused answers. Ultimately, it is our responsibility to understand, test, and validate the generated code.
Let’s leverage generative AI for coding; it significantly boosts productivity!
In the first video, titled "[Exposed] WRITE A COOKBOOK WITH CHATGPT PLAYGROUND [Part 2]," the creator discusses how to utilize ChatGPT for writing cookbooks, exploring its potential and limitations in this creative endeavor.
The second video, "Make $20 Daily with Short Books on Amazon KDP," offers insights into generating income through concise books on Amazon's Kindle Direct Publishing, showcasing practical strategies for success.